Bug #12614: AddSlashes doen't escape Curly braces "{"'s
| From: | mark at asplen dot co dot uk | Date: | Tue, 07 Aug 2001 10:28:58 +0000 |
| Subject: | Bug #12614: AddSlashes doen't escape Curly braces "{"'s | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-62393@lists.php.net to get a copy of this message | ||
From: mark@asplen.co.uk
Operating system: Linux
PHP version: 4.0CVS-2001-08-07
PHP Bug Type: Strings related
Bug description: AddSlashes doen't escape Curly braces "{"'s
AFAIK this is not fixed in versoins beyong 4.0.1pl2 which is what I'm
using.
I'm using PHP to modify Latex files - particularly to substitute PHP
variables with values from a database.
Therefore my Latex file could contain:
\textbf{$php_variable}
I read lines from the Latex file and use something like:
$input_line = AddSlashes( fgets($fp));
$str = eval($input_line);
As the input line includes a {$ the eval function assumes an array
calculation and the { is left out of the output string.
I've fixed the problem by adding an additional str_replace to escape the {
with \{ first.
Kind regards
Mark
--
Edit bug report at: http://bugs.php.net/?id=12614&edit=1