PHP allow bug
| From: | Hojtsy Gabor | 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: <?$1?>
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('!<\?([^?]*?)\?>!', '<?\1?>',
$text_blocks);
^^^^^^
But now, my first line changes
from: <?xml version="1.0" encoding="iso-8859-2"?>
to: <?xml version="1.0" encoding="iso-8859-2"?>
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([^?]*?)\?>!',
'<?php\1?>',
$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/