5 Commits
Author SHA1 Message Date
dualfroz 44481933b3 Describe this repository 2026-10-22 21:05:36 +02:00
dualfroz 6a4be2daab fix(Validators): allow pipe in pattern regular expressions
The 'pattern:' argument of Validators::is() crashed on a valid regular
expression containing a pipe, e.g. Validators::is('a', 'pattern:(a|b)').

Two parsing bugs combined: the expression was split into validators on every
'|', tearing the regexp apart, and the pipe was also used as the PCRE
delimiter. A 'pattern:' argument now consumes the rest of the expression and
the delimiter is changed to '~', with the pattern anchored as a whole so bare
alternations work too. Pipe-as-OR semantics for combined validators are kept.

Fixes nette/utils#206
2026-09-04 09:22:41 +02:00
upstream 5361db9bd4 Upstream nette/utils state of the touched files before bb71d240dd 2026-09-04 09:22:41 +02:00
dualfroz 4cded8d046 fix(Validators): allow pipe in pattern regular expressions
The 'pattern:' argument of Validators::is() crashed on a valid regular
expression containing a pipe, e.g. Validators::is('a', 'pattern:(a|b)').

Two parsing bugs combined: the expression was split into validators on every
'|', tearing the regexp apart, and the pipe was also used as the PCRE
delimiter. A 'pattern:' argument now consumes the rest of the expression and
the delimiter is changed to '~', with the pattern anchored as a whole so bare
alternations work too. Pipe-as-OR semantics for combined validators are kept.

Fixes nette/utils#206
2026-09-06 00:59:10 +02:00
upstream 385c8ee43f Upstream nette/utils state of the touched files before dc5e00bdb1 2026-09-04 09:22:41 +02:00