mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
Fixed bug #31341 (escape on curly inconsistent)
This commit is contained in:
parent
af0adbed39
commit
187b6cc583
1
NEWS
1
NEWS
@ -14,6 +14,7 @@ PHP NEWS
|
|||||||
- Fixed bug #33829 (mime_content_type() returns text/plain for gzip and bzip
|
- Fixed bug #33829 (mime_content_type() returns text/plain for gzip and bzip
|
||||||
files). (Derick)
|
files). (Derick)
|
||||||
- Fixed bug #34623 (Crash in pdo_mysql on longtext fields). (Ilia)
|
- Fixed bug #34623 (Crash in pdo_mysql on longtext fields). (Ilia)
|
||||||
|
- Fixed bug #31341 (escape on curly inconsistent). (Dmitry)
|
||||||
- Fixed bug #31177 (menory leaks and corruption because of incorrect
|
- Fixed bug #31177 (menory leaks and corruption because of incorrect
|
||||||
refcounting). (Dmitry)
|
refcounting). (Dmitry)
|
||||||
- Fixed bug #29983 (PHP does not explicitly set mime type & charset). (Ilia)
|
- Fixed bug #29983 (PHP does not explicitly set mime type & charset). (Ilia)
|
||||||
|
29
Zend/tests/bug31341.phpt
Executable file
29
Zend/tests/bug31341.phpt
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #31341 (escape on curly inconsistent)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$a = array(
|
||||||
|
"$ \{ ",
|
||||||
|
" \{ $",
|
||||||
|
" \{$ ",
|
||||||
|
" $\{ ",
|
||||||
|
" \$\{ ",
|
||||||
|
" \{\$ ",
|
||||||
|
"\$ \{ ",
|
||||||
|
" \{ \$",
|
||||||
|
"% \{ ");
|
||||||
|
|
||||||
|
foreach ($a as $v) {
|
||||||
|
echo("'$v'\n");
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
'$ \{ '
|
||||||
|
' \{ $'
|
||||||
|
' {$ '
|
||||||
|
' $\{ '
|
||||||
|
' $\{ '
|
||||||
|
' \{$ '
|
||||||
|
'$ \{ '
|
||||||
|
' \{ $'
|
||||||
|
'% \{ '
|
@ -1834,6 +1834,13 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
|||||||
return T_CHARACTER;
|
return T_CHARACTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\{$" {
|
||||||
|
zendlval->value.str.val = estrndup("{$", sizeof("{$")-1);
|
||||||
|
zendlval->value.str.len = sizeof("{$")-1;
|
||||||
|
zendlval->type = IS_STRING;
|
||||||
|
return T_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\"{ANY_CHAR} {
|
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\"{ANY_CHAR} {
|
||||||
switch (yytext[1]) {
|
switch (yytext[1]) {
|
||||||
case 'n':
|
case 'n':
|
||||||
@ -1851,9 +1858,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
|||||||
case '$':
|
case '$':
|
||||||
zendlval->value.lval = (long) yytext[1];
|
zendlval->value.lval = (long) yytext[1];
|
||||||
break;
|
break;
|
||||||
case '{':
|
|
||||||
zendlval->value.lval = (long) yytext[1];
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
zendlval->value.str.val = estrndup(yytext, yyleng);
|
zendlval->value.str.val = estrndup(yytext, yyleng);
|
||||||
zendlval->value.str.len = yyleng;
|
zendlval->value.str.len = yyleng;
|
||||||
|
Loading…
Reference in New Issue
Block a user