[TYPO3-core] RFC #10231: Bug: split() is deprecated in PHP 5.3 (second version)

Steffen Kamper info at sk-typo3.de
Thu Jan 22 19:59:28 CET 2009


Hi Karsten,

i looked to the patch and have some questions.

$XclassParts = preg_split('/if \(defined\([\'"]TYPO3_MODE[\'"]\) && 
\$TYPO3_CONF_VARS\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]/',$fContent,2);

could we extend this to match also $GLOBALS['TYPO3_CONF_VARS'] ?

-		$listArr = split(',|;|'.chr(10),$content);
+		$listArr = preg_split('/[,;'.chr(10).']/',$content);

there are other olaces using chr(10) as well, could we use \n there?

-			$kw = split('[ ,]',$sw);
+			$kw = preg_split('/[ ,]/',$sw);

is this correct? I doubt that it should be preg_split('/\[ ,\]/',$sw);

list($header,$content) = preg_split("/[\r\n\r\n]/", $res, 2);

do we need the double quotes here? Why is windows linebreak used here, 
possible would also be \n\n

$reg = preg_split('/[[:space:]=]/',$tag_tmp,2);

same as above, unescaped [] ?
I think it could also be explode(' =', $tag_tmp, 2)
comment above this line confuses me:
// ... We look for the next ' ' or '>'


there are some more simular to my comments (chr(10), unescaped [])
Beside that, could you add spaces after the commas?

Thx, vg Steffen


More information about the TYPO3-team-core mailing list