fixed bug when the filename of a template contains */
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 16 Nov 2009 12:36:34 +0000 (12:36 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 16 Nov 2009 12:36:34 +0000 (12:36 +0000)
git-svn-id: http://svn.twig-project.org/trunk@141 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/Node/Module.php

index f77f1dd..80a3df6 100644 (file)
@@ -106,7 +106,8 @@ class Twig_Node_Module extends Twig_Node implements Twig_NodeListInterface
     }
 
     $compiler
-      ->write("/* $this->filename */\n")
+      // if the filename contains */, add a blank to avoid a PHP parse error
+      ->write("/* ".str_replace('*/', '* /', $this->filename)." */\n")
       ->write('class '.$compiler->getTemplateClass($this->filename))
     ;