[TYPO3-core] RFC #9994: Bug: ereg_replace is deprecated in PHP 5.3 alpha3
Steffen Kamper
info at sk-typo3.de
Fri May 22 00:41:41 CEST 2009
Hi,
i broke it down.
Error happens in class.t3lib_syntaxhl.php line 383
This was the line before:
$markUpStr = ereg_replace('<([[:alnum:]_]+)[^>]*>',$token.'\1'.$token,$str);
was replaced by:
$markUpStr =
preg_replace('/<([[:alnum:]_]+)[^>]*>/',$token.'\1'.$token,$str);
(doesn't work)
I found this as working alternative:
$markUpStr =
preg_replace('/<([[:alnum:]_]+)[^>]*>/',"$token\\1$token",$str);
Alternative:
$markUpStr = preg_replace('/<([\w]+)[^>]*>/', "$token\\1$token", $str);
i'm not 100% sure if \w has too much in opposite of [:alnum:]_
vg Steffen
More information about the TYPO3-team-core
mailing list