Bug #14709
closedereg calls without escaped curly braces
0%
Description
e.g in typo3/mod/tools/em/index.php, line 2665
if (ereg('^class[[:space:]]*([[:alnum:]_]+)([[:alnum:][:space:]_]*){',$line,$reg)) {
results in an error in an installation with PHP 4.3.3 (reported by Thomas Ludescher on the Austrian TYPO3 mailinglist)
There are other occurences of unescaped curly braces in regular expressions all over the TYPO3 source code.
Curly braces have a special meaning in regular expressions and should therefore be escaped with a backslash "\" IMHO
TYPO3 3.7, 3.8(CVS)
(issue imported from #M1043)
Files
Updated by Karsten Dambekalns over 19 years ago
I just checked this with PHP 4.3.10, and there I get no error. So this seems to be a version-specific issue.
Anyway, the attached patch escapes the curly braces. Additionally it
- changes eregi to stristr where appropriate
- fixes two warnings by checking for data types
- changes all ereg* to preg* for speedup
I tested it locally and it works fine, but please have a look everybody. Thanks!
Updated by Karsten Dambekalns over 19 years ago
Applied the patch to CVS as there was no negative feedback.