Re: [SMARTY-DEV] modifier.escape.php bug
| From: | Monte Ohrt | Date: | Mon, 17 Feb 2003 21:13:47 +0000 |
| Subject: | Re: [SMARTY-DEV] modifier.escape.php bug | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-709@lists.php.net to get a copy of this message | ||
Thanks, that is a typo from commit earlier today... fixed.
Monte
On Mon, 2003-02-17 at 16:58, Eduardo wrote:
> Hi Monte,
>
> There is a bug in the cvs version of the escape modifier:
>
> ----------------------------
> case 'quotes':
> // escape unescaped single quotes
> return preg_replace("%(?<!\\\\)'%", "\\'",
> $string);
>
> case 'hex':
> // escape every character into hex
> BUG HERE==> return = '';
> for ($x=0; $x < strlen($string); $x++) {
> $return .= '%' . bin2hex($string[$x]);
> }
> return $return;
>
> case 'hexentity':
> BUG HERE==> return = '';
> for ($x=0; $x < strlen($string); $x++) {
> $return .= '&#x' . bin2hex($string[$x]) . ';';
> }
> return $return;
>
> -------------------------------------
>
> "parse error, unexpected '=' in modifier.escape.php on line 29"
>
>
>
> It should be $return = '';
>
>
>
> Eduardo Morales
>
--
Monte Ohrt <monte@ispi.net>