1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Validate hex colors when creating/editing labels (#34623) (#34630)

Backport #34623

---------

Co-authored-by: Kemal Zebari <kemalzebra@gmail.com>
This commit is contained in:
wxiaoguang
2025-06-07 16:24:28 +08:00
committed by GitHub
parent d35161ceb8
commit b1cc4bf77f

View File

@@ -50,7 +50,7 @@
<div class="field">
<label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label>
<div class="column js-color-picker-input">
<input name="color" value="#70c24a" placeholder="#c320f6" required maxlength="7">
<input name="color" value="#70c24a" placeholder="#c320f6" required pattern="^#?([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$" maxlength="7">
{{template "repo/issue/label_precolors"}}
</div>
</div>