|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12614 AddSlashes doen't escape Curly braces "{"'s
Submitted: 2001-08-07 06:28 UTC Modified: 2001-08-07 17:34 UTC
From: mark at asplen dot co dot uk Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.0CVS-2001-08-07 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mark at asplen dot co dot uk
New email:
PHP Version: OS:


 [2001-08-07 06:28 UTC] mark at asplen dot co dot uk
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:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-07 17:34 UTC]
That's one way to fix it. Another is to use addcslashes()
instead, but you might have to upgrade your version of php
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 17:03:36 2021 UTC