[PEAR-BUG] Bug #18454 [Com]: single quote is not escaped properly in yy_global_pattern
[email protected] ("michaelchisari")
| Newsgroups | php.pear.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at http://pear.php.net/bugs/bug.php?id=18454&edit=1
ID: 18454
Comment by: michaelchisari
Reported By: michael dot chisari at gmail dot com
Summary: single quote is not escaped properly in
yy_global_pattern
Status: Open
Type: Bug
Package: PHP_LexerGenerator
Operating System: Mac OS X
Package Version: 0.4.0
PHP Version: 5.3.6
New Comment:
Small fix for bug #18454
File: LexerGenerator/Regex/Parser.php
Line #: 1247
+ $this->yystack[$this->yyidx + 0]->minor->string = str_replace('\'',
'\\\'', $this->yystack[$this->yyidx + 0]->minor->string);
This will escape single-quotes properly in the pattern.
Previous Comments:
------------------------------------------------------------------------
[2011-04-18 22:01:47] urkle
Description:
------------
In revision 246683, a change was made to use single quotes instead of
double quotes to wrap the $yy_global_pattern variable contents..
However the content quoting was not changed.. (Double quotes are escaped
and single quotes are NOT escaped.).
This needs to be adjusted so that single quotes are escaped when placed
in that string.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18454&edit=1