[TYPO3-core] RFC: fix for bug #1596
Wolfgang Klinger
wolfgang at stufenlos.net
Wed Feb 22 13:41:13 CET 2006
*hiya!*
Type: bugfix
checkIncludeLines uses ereg and does not check for other whitespace
than space before and after <INCLUDE_TYPOSCRIPT>, the attached patch
fixes this.
BT reference: http://bugs.typo3.org/view.php?id=1596
bye
Wolfgang
-------------- next part --------------
--- TYPO3core/t3lib/class.t3lib_tsparser.php 2006-02-02 08:40:57.000000000 +0100
+++ TYPO3core_testing/t3lib/class.t3lib_tsparser.php 2006-02-22 13:11:08.000000000 +0100
@@ -452,9 +452,9 @@
while(list($c,$v)=each($allParts)) {
if (!$c) { // first goes through
$newString.=$v;
- } elseif (ereg("\r?\n[ ]*$",$allParts[$c-1])) { // There must be a line-break char before.
+ } elseif (preg_match('/\r?\n\s*$/',$allParts[$c-1])) { // There must be a line-break char before.
$subparts=explode('>',$v,2);
- if (ereg("^[ ]*\r?\n",$subparts[1])) { // There must be a line-break char after
+ if (preg_match('/^\s*\r?\n/',$subparts[1])) { // There must be a line-break char after
// SO, the include was positively recognized:
$newString.='### '.$splitStr.$subparts[0].'> BEGIN:'.chr(10);
$params = t3lib_div::get_tag_attributes($subparts[0]);
@@ -621,4 +621,4 @@
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tsparser.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tsparser.php']);
}
-?>
\ No newline at end of file
+?>
More information about the TYPO3-team-core
mailing list