Project

General

Profile

Actions

Bug #14934

closed

mb_ereg(): mbregex compile err

Added by Sebastian Widmann almost 19 years ago. Updated almost 18 years ago.

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

0%

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

Description

There might occur the following error in an extension-configuration-page in the extension manager:

Warning: mb_ereg(): mbregex compile err: invalid regular expression; there's no previous pattern, to which '{' would define cardinality at 2 in /var/kunden/webs/sites/domain.de/typo3/t3lib/class.t3lib_tsstyleconfig.php on line 247

This problem occurs, when mbstring.func_overload in the php.ini is not set to 0.

(issue imported from #M1390)


Files

bug_1390_v2.diff (848 Bytes) bug_1390_v2.diff Administrator Admin, 2006-03-23 15:35

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #15503: wrong ereg expression throws compile error warningClosed2006-01-25

Actions
Actions #1

Updated by Martin Sch¶nbeck over 18 years ago

The problem seems to be using " instead of ' in line 249.

if (ereg("^{[\$][a-zA-Z0-9\.]*}$",trim($fV),$reg)) { // Values entered from the constantsedit cannot be constants! 230502; removed \{ and set {

For me, it looks, as if somebody tried to check for a value of the form {something} but as PHP replaces escaped chars within " strings, the ereg never will get the \{, which was first tried. Replacing the " by ' and reinserting the \ in front of { and } removes the error message, but of course if have no idea, whether this is, what really was intended.

The same code you'll find in class.t3lib_tsparser_ext.php.

Actions #2

Updated by Michael Stucki over 18 years ago

The attached patch should solve the problem, though I didn't check it. Please confirm.

Actions #3

Updated by Martin Sch¶nbeck over 18 years ago

At the moment I have no chance to check the patch because I can't reproduce the error. It appeared very seldom f.e. when installing extensions.

But AFAIK the ^ in the beginning should fall behind the / and the $ at the end should be before the /. With this changes the patch would do the same (AFAICS) as an if (ereg('^\{[\$][a-zA-Z0-9\.]*\}$',trim($fV),$reg)) which I tested positively, when the error appeared.

Anyway I have no clue when this test should happen. So if anybody can tell it, I'll perhaps be able to reproduce it.

Actions #4

Updated by Michael Stucki over 18 years ago

Ouch! Of course you are right, I've changed that now.
What I find strange is that Kasper has added a comment on that line, stating the he changed the syntax from "\{" to "{". However, from a logical point of view, this seems to be a mistake.

Actions #5

Updated by Michael Stucki over 18 years ago

Fixed in CVS

Actions

Also available in: Atom PDF