Commit Graph
5 Commits
Author SHA1 Message Date
dualfroz 7b594c39c9 Describe this repository 2026-10-22 21:08:09 +02:00
dualfroz 811416bf63 fix: distinguish PCRE failure from a mismatch in Assert::regex()
preg_match() has three outcomes -- 1, 0 and false -- but regex() folded
false into the "no match" branch. An uncompilable pattern or an exhausted
PCRE limit therefore leaked a raw PHP warning out of the library and then
reported the misleading "The value ... does not match the expected pattern."

Check for false separately and report the pattern together with
preg_last_error_msg(), following the existing false === $x = nativeCall()
handling in Assert::strlen(). The caller's custom message is intentionally
not reused for that branch, since it describes a mismatch that never
happened. Matching values and genuine mismatches are unaffected.
2026-09-03 14:28:48 +02:00
upstream 74642583b5 Upstream webmozarts/assert state of the touched files before 381c97d823 2026-09-03 14:28:48 +02:00
dualfroz 24cce423ab fix: distinguish PCRE failure from a mismatch in Assert::regex()
preg_match() has three outcomes -- 1, 0 and false -- but regex() folded
false into the "no match" branch. An uncompilable pattern or an exhausted
PCRE limit therefore leaked a raw PHP warning out of the library and then
reported the misleading "The value ... does not match the expected pattern."

Check for false separately and report the pattern together with
preg_last_error_msg(), following the existing false === $x = nativeCall()
handling in Assert::strlen(). The caller's custom message is intentionally
not reused for that branch, since it describes a mismatch that never
happened. Matching values and genuine mismatches are unaffected.
2026-09-06 00:59:17 +02:00
upstream f6badd5191 Upstream webmozarts/assert state of the touched files before ce2a73faf1 2026-09-03 14:28:48 +02:00