PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Apr 2008, PHP 5.2.6
+- Fixed incorrect heredoc handling when label is used within the block.
+ (Matt Wilmas)
- Fixed bug #44673 (With CGI argv/argc starts from arguments, not from script)
(Dmitry)
- Fixed bug #44667 (proc_open() does not handle pipes with the mode 'wb'
if (yyleng > CG(heredoc_len) && !memcmp(end - CG(heredoc_len), CG(heredoc), CG(heredoc_len))) {
int len = yyleng - CG(heredoc_len) - 2; /* 2 for newline before and after label */
- if (len > 0 && yytext[len - 1] == '\r' && yytext[len] == '\n') {
- len--;
+ /* May have matched fooLABEL; make sure there's a newline before it */
+ if (yytext[len] != '\n') {
+ if (yytext[len] != '\r') {
+ goto wrong_label;
+ }
+ } else if (len > 0 && yytext[len - 1] == '\r') {
+ len--; /* Windows newline */
}
/* Go back before last label char, to match in ST_END_HEREDOC state */
} else {
/* Go back to end of label, so the next match works correctly in case of
* a variable or another label at the beginning of the next line */
+wrong_label:
yyless(yyleng - 1);
yymore();
}