]> granicus.if.org Git - php/commitdiff
Fix bug #55445 (Incomplete implementation of <?= being independant of short_open_tag)
authorEtienne Kneuss <colder@php.net>
Wed, 17 Aug 2011 23:50:04 +0000 (23:50 +0000)
committerEtienne Kneuss <colder@php.net>
Wed, 17 Aug 2011 23:50:04 +0000 (23:50 +0000)
Zend/tests/bug55445.phpt [new file with mode: 0644]
Zend/zend_language_scanner.c
Zend/zend_language_scanner.l
Zend/zend_language_scanner_defs.h

diff --git a/Zend/tests/bug55445.phpt b/Zend/tests/bug55445.phpt
new file mode 100644 (file)
index 0000000..0f36ac5
--- /dev/null
@@ -0,0 +1,8 @@
+--TEST--
+Bug #55445 (Lexer error with short open tags)
+--INI--
+short_open_tag=0
+--FILE--
+<?php $u = "chris"; ?><p>Welcome <?= $u ?></p>
+--EXPECTF--
+<p>Welcome chris</p>
index c7301b2c7c287f533fe15dca6a506f4af4278018..0cb03e85b02d9964ac6028d00c47715a28e93d5f 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Tue Aug 16 12:22:59 2011 */
+/* Generated by re2c 0.13.5 on Thu Aug 18 01:37:48 2011 */
 #line 1 "Zend/zend_language_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -1099,7 +1099,7 @@ inline_char_handler:
                if (YYCURSOR < YYLIMIT) {
                        switch (*YYCURSOR) {
                                case '?':
-                                       if (CG(short_tags) || !strncasecmp(YYCURSOR + 1, "php", 3)) { /* Assume [ \t\n\r] follows "php" */
+                                       if (CG(short_tags) || !strncasecmp(YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
                                                break;
                                        }
                                        continue;
index 0e3583472f79eb43def689b07c5e7e0b34ecb51d..827b7bf3d72816903f20334db7037fc58b4b9b0a 100644 (file)
@@ -1780,7 +1780,7 @@ inline_char_handler:
                if (YYCURSOR < YYLIMIT) {
                        switch (*YYCURSOR) {
                                case '?':
-                                       if (CG(short_tags) || !strncasecmp(YYCURSOR + 1, "php", 3)) { /* Assume [ \t\n\r] follows "php" */
+                                       if (CG(short_tags) || !strncasecmp(YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
                                                break;
                                        }
                                        continue;
index 84ec3a480f6c68c57c7d0c31d22e1f9f3a11d07b..069fe7ec2323e178b4d9e6fe311ded96da630ec0 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sun Jul 31 20:09:38 2011 */
+/* Generated by re2c 0.13.5 on Thu Aug 18 01:37:48 2011 */
 #line 3 "Zend/zend_language_scanner_defs.h"
 
 enum YYCONDTYPE {