96323[BUGFIX] Skip invalid attribute names in implodeAttributes()
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 2
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/23/96323/2 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/23/96323/2 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V -1 Blocked
- core-ci -1 CI
Merge conflicts 3
Issues 2
Files 4
Review log 68
-
Benni Mack uploaded patch set 1 10/02/26, 16:35
-
core-ci voted on patch set 1 V -1 10/02/26, 16:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109975
-
Benni Mack commented on patch set 2
V -110/05/26, 07:24Published edit on patch set 1. -
Benni Mack marked it work in progress 10/05/26, 07:27
-
core-ci voted on patch set 2 V -1 10/05/26, 07:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110076
-
Ayke Halder commented on patch set 2 10/05/26, 10:30
GeneralUtility.php:1027UnresolvedDo we need to also skip invalid attribute names here?GeneralUtility.php:1071```suggestion '/(?:' . '[\x{0000}-\x{0020}\x{007F}-\x{009F}"\'>\/=\x{FDD0}-\x{FDEF}]' . '|\x{FFFE}|\x{FFFF}|\x{1FFFE}|\x{1FFFF}|\x{2FFFE}|\x{2FFFF}|\x{3FFFE}|\x{3FFFF}' . '|\x{4FFFE}|\x{4FFFF}|\x{5FFFE}|\x{5FFFF}|\x{6FFFE}|\x{6FFFF}|\x{7FFFE}|\x{7FFFF}' . '|\x{8FFFE}|\x{8FFFF}|\x{9FFFE}|\x{9FFFF}|\x{AFFFE}|\x{AFFFF}|\x{BFFFE}|\x{BFFFF}' . '|\x{CFFFE}|\x{CFFFF}|\x{DFFFE}|\x{DFFFF}|\x{EFFFE}|\x{EFFFF}|\x{FFFFE}|\x{FFFFF}' . '|\x{10FFFE}|\x{10FFFF}' . ')/u', ``` This should be slightly faster. AI: "For sparse, repeating patterns across 17 planes (like U+nFFFE / U+nFFFF), explicit alternation allows PCRE to build an optimized lookup trie without needing complex range math." „PCRE's DFA/JIT compiler analyzes the list during compilation and constructs an internal prefix trie (a state machine tree).„ ``` ┌─> 0x0FFFE ├─> 0x0FFFF ├─> 0x1FFFE ┌─> ... ─┼─> ... Root ────┼─> 0x4 ─┼─> 0x4FFFE │ └─> 0x4FFFF └─> ... ─> 0x10FFFF ``` -
Garvin Hicking commented on patch set 2 10/16/26, 09:42
@benni@typo3.org Could you maybe make a benchmark on the full test suite run with and without this change? I'd be curious to know if running the regexp engine on a method that might be called very often (for small strings most likely) has a meaningful impact. And maybe we should use mb_strtolower? -
Ayke Halder commented on patch set 2 10/19/26, 16:07
Reply Unresolved
UTF-8 validation which is triggered for newly created/concatenated strings by `preg_match('//u', …)` takes a big bite of computation time: https://3v4l.org/u3sWB#v8.5.11GeneralUtility.php:1071ReplyBenchmark shows no impact - or even a decline in performance. https://3v4l.org/VbfOK#v8.5.11 ``` Execution time A: 0.065146 sec. Execution time B: 0.066489 sec. Execution time A: 0.065246 sec. Execution time B: 0.066766 sec. Execution time A: 0.065190 sec. Execution time B: 0.066526 sec. ```