Project

General

Profile

Actions

Bug #18643

closed

TypoScript Constant Editor produces PHP Warning: ereg() Invalid preceding regular expression in class.t3lib_tsparser_ext.php

Added by LUBRANO J.F. over 16 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2008-04-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I am training with "typo 3 pour les nuls" and when I try to build a custom template (see page 20) access to template/constant editor fire the following message :
Warning: ereg() [function.ereg]: Invalid preceding regular expression in /home.10/swisscot/www/cms/t3lib/class.t3lib_tsparser_ext.php on line 1099

looking to line 1099 in class.t3lib_tsparser_ext.php I see :

if (ereg('^{[\$][a-zA-Z0-9\.]*}$',trim($fV),$reg))

The regular expression seems to be strange. Trying to replace "{" with "("
and "}" with ")" suppress the message

Is it a good solution ?

P.S. I am not specialist with PHP and regular expressions
(issue imported from #M8161)


Files

0008161.patch (1.3 KB) 0008161.patch Administrator Admin, 2008-04-23 20:00

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #14709: ereg calls without escaped curly bracesClosedKarsten Dambekalns2005-04-28

Actions
Related to TYPO3 Core - Bug #19728: ereg* is deprecated in PHP 5.3 alpha3ClosedKarsten Dambekalns2008-12-21

Actions
Actions #1

Updated by LUBRANO J.F. over 16 years ago

Finally, I think,replacing "{" with "(" and "}" with ")", is not a good idea ... Searching Bugtrack I find a report (ID=1043) with a similar problem.

Now I replace "{" with "\{" and "}" with "\}" (escaping sequence) and the result is better.

If somebody can give an advice on the method ...

Actions #2

Updated by Oliver Hader over 16 years ago

How does your own constant template look like?

Actions #3

Updated by Oliver Hader over 16 years ago

The attached patch rewrites the ereg call to a preg_match call (as clean up).
However I could not reproduce the behaviour you mentioned.

Actions #4

Updated by Olivier SC about 16 years ago

hello,
Even if this bug is quite old, I can reproduce this behaviour.

On a fresh clean typo3 4.2.2 installation, with a very simple typoscript template (only a page object, with 1 suboject).

-If i use like that, there is no problem with the constant editor.
-If I add to this typoscript template in the part "include static from extension" the template "css_style_content", and go back to the constant editor, I now see LOTS of messages like this on :
Warning: ereg() [function.ereg]: Invalid preceding regular expression in /...../..../www/t3lib/class.t3lib_tsparser_ext.php on line 1104

Last thing, I've T3editor extension enabled.
I hope that could help.

Actions #5

Updated by Fedir RYKHTIK about 15 years ago

Confirmation of the bug.
Patch of Olivier resolves the problem.
Looks like limited configuration of PHP.

Actions #6

Updated by Chris topher over 14 years ago

The code has been changed to use preg_match for issue #19728.

Is the error still reproducable for you?

Actions #7

Updated by Oliver Hader over 14 years ago

No feedback given. Besides that I could not find the mentioned code part anymore (due to other fixes in between).

Actions #8

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF