Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3716 - improve validation of id widget #4686

Merged
merged 47 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
39cd44b
Extend Id widget validation rules
tedw87 Apr 10, 2023
371b50d
update snapshots
tedw87 Apr 10, 2023
f07d6fe
add validation for empty string
tedw87 Apr 10, 2023
a0d22c1
add validation rules to allow only 7-bit bytes characters
tedw87 Apr 11, 2023
4259213
fix: cannot add illegal characters in URLs \x7F
tedw87 Apr 11, 2023
7a8c51e
update po files
tedw87 Apr 12, 2023
4417cde
fix ESlint error
tedw87 Apr 12, 2023
82efa98
fix gramar issue
tedw87 Apr 12, 2023
55931a6
regenerate volto.pot
tedw87 Apr 12, 2023
9ae9012
updated translation
tedw87 Apr 12, 2023
3eedbb4
fix:changed validation message
tedw87 Apr 19, 2023
5b5965f
Merge branch 'master' into 3716-improve-validation-of-IdWidget
claudiaifrim Apr 27, 2023
db4caa3
fix: resolve conflicts - merge master
claudiaifrim Nov 21, 2023
e42e54f
fix: prettier fix
claudiaifrim Nov 21, 2023
b2e028f
fix: i18n
claudiaifrim Nov 21, 2023
8ae5495
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Nov 22, 2023
e3d328f
feat: disallow uppercase letters and keywords request and contributors
tedw87 Nov 22, 2023
005fe01
update snapshot
tedw87 Nov 22, 2023
a744515
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Nov 24, 2023
5f14c9a
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Nov 24, 2023
1b4fb30
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Nov 25, 2023
ca4d82a
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Nov 25, 2023
8b7a6ae
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Nov 27, 2023
00216fd
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Nov 28, 2023
a8558ec
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Dec 4, 2023
dd0055c
add news file
tedw87 Dec 4, 2023
5252d24
remove news file from older location
tedw87 Dec 4, 2023
ef4e0b4
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Dec 11, 2023
219d017
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Dec 13, 2023
6e31fcb
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Dec 18, 2023
be74d5e
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Dec 20, 2023
2dd9a34
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 8, 2024
c9110a9
Merge branch 'main' into 3716-improve-validation-of-IdWidget
tedw87 Jan 11, 2024
800b0bd
update storybook
tedw87 Jan 11, 2024
f5668c5
resolve conflicts incoming from main branch
tedw87 Jan 12, 2024
b92cb7f
generate languages with i18n
tedw87 Jan 12, 2024
52a3779
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 17, 2024
2559a52
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Jan 18, 2024
9a0ca66
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Jan 19, 2024
ecf4162
Merge branch 'main' into 3716-improve-validation-of-IdWidget
claudiaifrim Jan 23, 2024
e012e39
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 23, 2024
069ab0a
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 24, 2024
95a7af5
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 25, 2024
23d8c90
Update regex to disallow all backslash escape sequences
tedw87 Jan 25, 2024
2f38ee0
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 25, 2024
6682c53
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 25, 2024
51c235f
Merge remote-tracking branch 'origin/main' into 3716-improve-validati…
tedw87 Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions locales/ca/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2303,8 +2303,8 @@ msgid "Ok"
msgstr "D'acord"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr ""

#: components/manage/Blocks/Image/schema
Expand Down
6 changes: 3 additions & 3 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2300,9 +2300,9 @@ msgid "Ok"
msgstr "OK"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr "Nur Kleinbuchstaben (a-z) ohne Umlaute oder Sonderzeichen, Zahlen (0-9) und die beiden Zeichen "-" und "_", und "." sind erlaubt."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "Es sind nur 7-Bit-Byte-Zeichen zulässig. Darf keine Zeichen enthalten wie:<, >, &, #, /, ?. Kann nicht beginnen mit: _, aq_, @@, ++. Kann nicht mit __ enden. Darf nicht diese spezifischen Schlüsselwörter sein: REQUEST, ., ..,"" oder andere Zeichen, die in URLs unzulässig sind. Keine neuen Zeilen erlaubt."

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
4 changes: 2 additions & 2 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2294,8 +2294,8 @@ msgid "Ok"
msgstr ""

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr ""

#: components/manage/Blocks/Image/schema
Expand Down
6 changes: 3 additions & 3 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2305,9 +2305,9 @@ msgid "Ok"
msgstr "Ok"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr "Solo letras minúsculas (a-z) sin tildes, números (0-9), y los caracteres "-", "_", y "." están permitidos."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "Solo se permiten caracteres de bytes de 7 bits. No puede contener caracteres como: <, >, &, #, /, ?. No puede comenzar con: _, aq_, @@, ++. No puede terminar con __. No pueden ser estas palabras clave específicas: REQUEST, ., ..,"" o cualquier otro carácter que sea ilegal en las URL. No se permiten nuevas líneas."

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
6 changes: 3 additions & 3 deletions locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2301,9 +2301,9 @@ msgid "Ok"
msgstr "Ados"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr "Letra xeheak (a-z), karaktere berezi gabe, zenbakiak (0-9) eta "-", "_" eta "." ikurrak bakarrik erabili daitezke."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "7 biteko karaktereak soilik onartzen dira. Ezin du izan:<, >, &, #, /, ? bezalako karaktereak. Ezin da hasi: _, aq_, @@, ++. Ezin da __rekin amaitu. Ezin dira gako-hitz hauek izan: REQUEST, ., ..,"" edo URLetan legez kanpokoak diren beste karaktere batzuk. Ez da lerro berririk onartzen."

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
6 changes: 3 additions & 3 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2311,9 +2311,9 @@ msgid "Ok"
msgstr "Ok"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr "Uniquement des caractères en minuscules (a-z) sans accents, chiffres (0-9), et les caractères "-", "_", and "." sont autorisés."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "Seuls les caractères d'octets de 7 bits sont autorisés. Ne peut pas contenir de caractères tels que :<, >, &, #, /, ?. Ne peut pas commencer par : _, aq_, @@, ++. Ne peut pas se terminer par __. Il ne peut pas s'agir de ces mots clés spécifiques : REQUEST, ., .."" ou de tout autre caractère illégal dans les URL. Aucune nouvelle ligne autorisée."

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
4 changes: 2 additions & 2 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2294,8 +2294,8 @@ msgid "Ok"
msgstr "Ok"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr ""

#: components/manage/Blocks/Image/schema
Expand Down
4 changes: 2 additions & 2 deletions locales/ja/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2302,8 +2302,8 @@ msgid "Ok"
msgstr "OK"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr ""

#: components/manage/Blocks/Image/schema
Expand Down
6 changes: 3 additions & 3 deletions locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2301,9 +2301,9 @@ msgid "Ok"
msgstr "Ok"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr "Enkel kleine letters (a-z) zonder accenten, cijfers (0-9) en de karakters '-', '_' en '.' zijn toegelaten."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "Er zijn alleen 7-bits bytes-tekens toegestaan. Mag geen tekens bevatten zoals:<, >, &, #, /, ?. Kan niet beginnen met: _, aq_, @@, ++. Kan niet eindigen op __. Dit mogen niet de volgende specifieke zoekwoorden zijn: REQUEST, ., ..,"" of andere tekens die illegaal zijn in URL's. Geen nieuwe regels toegestaan."

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
6 changes: 3 additions & 3 deletions locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2302,9 +2302,9 @@ msgid "Ok"
msgstr "Ok"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr ""
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "Somente caracteres de bytes de 7 bits são permitidos. Não pode conter caracteres como:<, >, &, #, /, ?. Não pode começar com: _, aq_, @@, ++. Não pode terminar com __. Não podem ser estas palavras-chave específicas: REQUEST, ., ..,"" ou quaisquer outros caracteres ilegais em URLs. Não são permitidas novas linhas."

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
6 changes: 3 additions & 3 deletions locales/pt_BR/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2304,9 +2304,9 @@ msgid "Ok"
msgstr "Ok"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr "Apenas letras minúsculas (a-z) sem acentos, números (0-9), e os caracteres ‘-‘, ‘_’, e ‘.’ são permitidos."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "Somente caracteres de bytes de 7 bits são permitidos. Não pode conter caracteres como:<, >, &, #, /, ?. Não pode começar com: _, aq_, @@, ++. Não pode terminar com __. Não podem ser estas palavras-chave específicas: REQUEST, ., ..,"" ou quaisquer outros caracteres ilegais em URLs. Não são permitidas novas linhas."

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
4 changes: 2 additions & 2 deletions locales/ro/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2294,8 +2294,8 @@ msgid "Ok"
msgstr "Ok"

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr ""

#: components/manage/Blocks/Image/schema
Expand Down
6 changes: 3 additions & 3 deletions locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2023-04-05T10:12:20.363Z\n"
"POT-Creation-Date: 2023-04-12T17:56:01.000Z\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -2296,8 +2296,8 @@ msgid "Ok"
msgstr ""

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr ""

#: components/manage/Blocks/Image/schema
Expand Down
6 changes: 3 additions & 3 deletions locales/zh_CN/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2300,9 +2300,9 @@ msgid "Ok"
msgstr ""

#: components/manage/Widgets/IdWidget
# defaultMessage: Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
msgid "Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed."
msgstr "只允许不带读音号的小写字母(a-z),数字(0-9),和符号:_,-,.。"
# defaultMessage: Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.
msgid "Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed."
msgstr "只允许 7 位字节字符。 不能包含以下字符:<、>、&、#、/、?。 不能以:_、aq_、@@、++ 开头。 不能以 __ 结尾。 不能是这些特定关键字:REQUEST、.、..、"" 或 URL 中非法的任何其他字符。 不允许换行。"

#: components/manage/Blocks/Image/schema
#: components/manage/Blocks/LeadImage/LeadImageSidebar
Expand Down
1 change: 1 addition & 0 deletions news/3716.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Extend Id widget validation rules - Fix: #3716 @tedw87
11 changes: 8 additions & 3 deletions src/components/manage/Widgets/IdWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const messages = defineMessages({
},
invalidCharacters: {
id:
'Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.',
'Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.',
defaultMessage:
'Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.',
'Only 7-bit bytes characters are allowed. Cannot contain characters like:<, >, &, #, /, ?. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be these specific keywords: REQUEST, ., ..,"", or any other characters that are illegal in URLs. No new lines allowed.',
},
});

Expand Down Expand Up @@ -141,7 +141,12 @@ class IdWidget extends Component {
}

// Check invalid characters
if (!/^[.a-z0-9_-]*$/.test(value)) {
if (
// eslint-disable-next-line no-control-regex
!/^(?!\+\+)(?!@@)(?!.*REQUEST)(?!aq_)(?!.*__)(?!_)(?!((^|\/)\.\.?($|\/)|^"\s*"$))(?:(?![\r\n<>/?&#\x00-\x1F\x7F])['\x00-\x7F\u0080-\uFFFF. _])*$/.test(
value,
)
) {
error.push(this.props.intl.formatMessage(messages.invalidCharacters));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ exports[`IdWidget renders an id widget with an reserved name 1`] = `
exports[`IdWidget renders an id widget with invalid characters 1`] = `
<div>
<div
class="error inline field text field-wrapper-my-field"
class="inline field text field-wrapper-my-field"
>
<div
class="ui grid"
Expand Down Expand Up @@ -223,11 +223,6 @@ exports[`IdWidget renders an id widget with invalid characters 1`] = `
value="Test id"
/>
</div>
<div
class="ui red pointing basic label"
>
Only lowercase letters (a-z) without accents, numbers (0-9), and the characters "-", "_", and "." are allowed.
</div>
</div>
</div>
</div>
Expand Down