]> granicus.if.org Git - php/commitdiff
fix last part of bug #44654
authorNuno Lopes <nlopess@php.net>
Sun, 6 Jul 2008 16:20:51 +0000 (16:20 +0000)
committerNuno Lopes <nlopess@php.net>
Sun, 6 Jul 2008 16:20:51 +0000 (16:20 +0000)
Zend/zend_language_scanner.l
tests/lang/bug44654.phpt [new file with mode: 0755]

index e8b8cd7f432df671d4f28af10a0d5313d2a99c8c..1169c0d169db44577b7b9d26fe8bcb7d648d3661 100644 (file)
@@ -1620,6 +1620,7 @@ NOWDOC_CHARS              ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_
                /* ignore first line when it's started with a # */
                goto restart;
        } else {
+               YYCURSOR = yytext+1;
                goto inline_char_handler;
        }
 }
@@ -1640,7 +1641,7 @@ inline_char_handler:
                        YYCURSOR = ptr + 1;
 
                        /* if it can be an opening tag, stop */
-                       if (ptr < YYLIMIT && (*YYCURSOR == '?' || *YYCURSOR == '%')) {
+                       if (YYCURSOR < YYLIMIT && (*YYCURSOR == '?' || *YYCURSOR == '%')) {
                                --YYCURSOR;
                                yyleng = YYCURSOR - SCNG(yy_text);
                                break;
diff --git a/tests/lang/bug44654.phpt b/tests/lang/bug44654.phpt
new file mode 100755 (executable)
index 0000000..7e7f973
--- /dev/null
@@ -0,0 +1,8 @@
+--TEST--
+Bug #44654 (syntax error for #)
+--FILE--
+#<?php echo 1; ?>
+<?php if (1) { ?>#<?php } ?>
+#<?php echo 1; ?>
+--EXPECT--
+##1