Re: [SMARTY-DEV] Backslashes mangles output of timwhitespace outputfilter?
| From: | messju mohr | Date: | Fri, 02 May 2003 23:02:24 +0000 |
| Subject: | Re: [SMARTY-DEV] Backslashes mangles output of timwhitespace outputfilter? | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1333@lists.php.net to get a copy of this message | ||
On Tue, Apr 29, 2003 at 12:27:47PM -0300, luis wrote:
> Hi,
>
> If the output has backslashes like hey\0foo the trimwhitespace
> outputfilter does some very weird
> things, some regex maybe intepreting the \0 as a backreference or
> similar.
> Can you check this please?
> Tks!
ich checked this roughly. '\0' (literally, this means 2 chars) does
not make any problems with trimwhitespace for me.
but "\0" (being chr(0), this means 1 char) makes problems.
this is due to an issue of nullbyte-handling in
preg_replace. believing the NEWS-file of php this should have been
fixed in php-4.2.0 for preg_match_all() (which is used by
trimwhitespace) but it seems to work only since version 4.3.0 . maybe
it interferes with a fix for preg_split that has been introduced in
php-4.3.0.
anyway: it seems to be a php-problem, not a smarty problem. and "\0"
means eof anyway, i don't see a need for this inside a template
(especially not in a <textarea>).
HTH
messju