Project

General

Profile

Actions

Bug #14709

closed

ereg calls without escaped curly braces

Added by Wolfgang Klinger about 19 years ago. Updated almost 18 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2005-04-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0rc1
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

mod-tools-em-index.php.diff (7.58 KB) mod-tools-em-index.php.diff Administrator Admin, 2005-05-17 11:50

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #14539: check for the include_once statement for XCLASSClosedMichael Stucki2005-02-08

Actions
Related to TYPO3 Core - Bug #15047: <INCLUDE_TYPOSCRIPT> / checkIncludeLines method bugClosedWolfgang Klinger2005-10-13

Actions
Related to TYPO3 Core - Bug #18643: TypoScript Constant Editor produces PHP Warning: ereg() Invalid preceding regular expression in class.t3lib_tsparser_ext.phpClosedOliver Hader2008-04-19

Actions
Actions #1

Updated by Karsten Dambekalns about 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!

Actions #2

Updated by Karsten Dambekalns about 19 years ago

Please test the attached patch.

Actions #3

Updated by Karsten Dambekalns about 19 years ago

Applied the patch to CVS as there was no negative feedback.

Actions

Also available in: Atom PDF