* Fixed bug #8009: Wrong TS-Code because appendString cannot handle multiline strings
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tsparser.php
index 9032bad..cb41644 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -256,6 +256,12 @@ class t3lib_TSparser {
                                                                        $tsFuncArg = $match[2];
                                                                        list ($currentValue) = $this->getVal($objStrName,$setup);
 
                                                                        $tsFuncArg = $match[2];
                                                                        list ($currentValue) = $this->getVal($objStrName,$setup);
 
+                                                                       $tsFuncArg = str_replace(
+                                                                               array('\\\\', '\n','\t'),
+                                                                               array('\\', chr(10),chr(9)),
+                                                                               $tsFuncArg
+                                                                       );
+
                                                                        switch ($tsFunc)        {
                                                                                case 'prependString':
                                                                                        $newValue = $tsFuncArg . $currentValue;
                                                                        switch ($tsFunc)        {
                                                                                case 'prependString':
                                                                                        $newValue = $tsFuncArg . $currentValue;
@@ -345,7 +351,7 @@ class t3lib_TSparser {
                                                                                $this->setVal($objStrName,$setup,'UNSET');
                                                                        break;
                                                                        default:
                                                                                $this->setVal($objStrName,$setup,'UNSET');
                                                                        break;
                                                                        default:
-                                                                               $this->error('Line '.($this->lineNumberOffset+$this->rawP-1).': Object Name String, "'.htmlspecialchars($objStrName).'" was not preceeded by any operator, =<>({');
+                                                                               $this->error('Line '.($this->lineNumberOffset+$this->rawP-1).': Object Name String, "'.htmlspecialchars($objStrName).'" was not preceded by any operator, =<>({');
                                                                        break;
                                                                }
                                                        }
                                                                        break;
                                                                }
                                                        }