ID: 12614
Updated by: vlad
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Strings related
Operating System: Linux
PHP Version: 4.0CVS-2001-08-07
New Comment:

That's one way to fix it. Another is to use addcslashes()
instead, but you might have to upgrade your version of php
first.

Previous Comments:
------------------------------------------------------------------------

[2001-08-07 06:28:58] [EMAIL PROTECTED]

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 this bug report at http://bugs.php.net/?id=12614&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to