Bug #14934
closedmb_ereg(): mbregex compile err
0%
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
Updated by Martin Sch¶nbeck almost 19 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.
Updated by Michael Stucki over 18 years ago
The attached patch should solve the problem, though I didn't check it. Please confirm.
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.
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.