PHP allow bug

From: Date: Sun, 18 Feb 2001 10:57:44 +0000
Subject: PHP allow bug
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-136@lists.php.net to get a copy of this message
Hi Monte, Andrei and all the folks! I have asked about the xml compatibility in Smarty last day, and made some research... I have found out that the code changing my first template line from: <?xml version="1.0" encoding="iso-8859-2"?> to: &lt;?$1?&gt; is in Smarty.class.php on line 351 (with 1.2.2). This is a bug anyway, while you are trying to escape the PHP code you use $1 instead of \1. So this is a bug in Smarty and need to be changed to: $text_blocks = preg_replace('!<\?([^?]*?)\?>!', '&lt;?\1?&gt;', $text_blocks); ^^^^^^ But now, my first line changes from: <?xml version="1.0" encoding="iso-8859-2"?> to: &lt;?xml version="1.0" encoding="iso-8859-2"?&gt; This is not good either. So you need to narrow the embedded php code support to normal PHP tags, and no short PHP tags, to support XML generation: $text_blocks = preg_replace('!<\?php([^?]*?)\?>!', '&lt;?php\1?&gt;', $text_blocks); And now you need to set short_open_tags off, but then comes the parse error on line 418, which I mentioned in one of my last posts... The compiled template is finally xml compatible but, PHP 4.0.3pl1 can't parse Smarty.class.php with short open tags turned off... :(((((((((((((((((((((((((((((((((((((((((((((((((( Goba __________________________________________________________________ Hungarian PHP Manual :: Hungarian PHP Mirror :: http://hu.php.net/ The starintg-point for Hungarian webmasters :: http://weblabor.hu/

« previous php.smarty.general (#136) next »