fixed \ usage in a HTML string
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Thu, 5 Nov 2009 17:06:00 +0000 (17:06 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Thu, 5 Nov 2009 17:06:00 +0000 (17:06 +0000)
git-svn-id: http://svn.twig-project.org/trunk@111 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/Compiler.php

index f91d9ba..95d7f00 100644 (file)
@@ -113,7 +113,7 @@ class Twig_Compiler implements Twig_CompilerInterface
    */
   public function string($value)
   {
-    $this->source .= sprintf('"%s"', addcslashes($value, "\t\"\$"));
+    $this->source .= sprintf('"%s"', str_replace('\\\n', "\n", addcslashes($value, "\t\"\$\\")));
 
     return $this;
   }