]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #41600 (url rewriter tags doesn't work with namespaced tags).
authorIlia Alshanetsky <iliaa@php.net>
Wed, 6 Jun 2007 00:01:13 +0000 (00:01 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 6 Jun 2007 00:01:13 +0000 (00:01 +0000)
ext/session/tests/bug41600.phpt [new file with mode: 0644]
ext/standard/url_scanner_ex.c
ext/standard/url_scanner_ex.re

diff --git a/ext/session/tests/bug41600.phpt b/ext/session/tests/bug41600.phpt
new file mode 100644 (file)
index 0000000..d79cff3
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+Bug #41600 (url rewriter tags doesn't work with namespaced tags
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--INI--
+session.use_cookies=0
+session.cache_limiter=
+session.use_trans_sid=1
+arg_separator.output=&amp;
+session.name=PHPSESSID
+session.serialize_handler=php
+session.save_handler=files
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+session_id("abtest");
+session_start();
+?>
+<a href="link.php?a=b">
+<?php
+session_destroy();
+?>
+--EXPECT--
+<a href="link.php?a=b&amp;PHPSESSID=abtest">
index 2dcd52523fc2058e697decf679c4a4d9860ba37e..e05a4b33c616fe12bacd6e93132905cf7fa73e0c 100644 (file)
@@ -1,10 +1,10 @@
-/* Generated by re2c 0.10.1 on Sat Jun  3 12:59:33 2007 */
-#line 1 "ext/standard/url_scanner_ex.re"
+/* Generated by re2c 0.11.0 on Tue Jun  5 20:00:54 2007 */
+#line 1 "url_scanner_ex.re"
 /*
   +----------------------------------------------------------------------+
   | PHP Version 5                                                        |
   +----------------------------------------------------------------------+
-  | Copyright (c) 1997-2007 The PHP Group                                |
+  | Copyright (c) 1997-2006 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 3.01 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
@@ -91,7 +91,7 @@ PHP_INI_BEGIN()
        STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals)
 PHP_INI_END()
 
-#line 97 "ext/standard/url_scanner_ex.re"
+#line 98 "url_scanner_ex.re"
 
 
 #define YYFILL(n) goto done
@@ -145,7 +145,7 @@ scan:
                128, 128, 128, 128, 128, 128, 128, 128, 
        };
 
-#line 149 "ext/standard/url_scanner_ex.c"
+#line 149 "url_scanner_ex.c"
        {
                YYCTYPE yych;
 
@@ -157,19 +157,19 @@ scan:
                if(yych <= '9') goto yy6;
                if(yych >= ';') goto yy4;
                ++YYCURSOR;
-#line 115 "ext/standard/url_scanner_ex.re"
+#line 116 "url_scanner_ex.re"
                { smart_str_append(dest, url); return; }
-#line 163 "ext/standard/url_scanner_ex.c"
+#line 163 "url_scanner_ex.c"
 yy4:
                ++YYCURSOR;
-#line 116 "ext/standard/url_scanner_ex.re"
+#line 117 "url_scanner_ex.re"
                { sep = separator; goto scan; }
-#line 168 "ext/standard/url_scanner_ex.c"
+#line 168 "url_scanner_ex.c"
 yy6:
                ++YYCURSOR;
-#line 117 "ext/standard/url_scanner_ex.re"
+#line 118 "url_scanner_ex.re"
                { bash = p - 1; goto done; }
-#line 173 "ext/standard/url_scanner_ex.c"
+#line 173 "url_scanner_ex.c"
 yy8:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -177,12 +177,12 @@ yy8:
                if(yybm[0+yych] & 128) {
                        goto yy8;
                }
-#line 118 "ext/standard/url_scanner_ex.re"
+#line 119 "url_scanner_ex.re"
                { goto scan; }
-#line 183 "ext/standard/url_scanner_ex.c"
+#line 183 "url_scanner_ex.c"
        }
 }
-#line 119 "ext/standard/url_scanner_ex.re"
+#line 120 "url_scanner_ex.re"
 
 done:
        
@@ -386,7 +386,7 @@ state_plain:
                128, 128, 128, 128, 128, 128, 128, 128, 
        };
 
-#line 390 "ext/standard/url_scanner_ex.c"
+#line 390 "url_scanner_ex.c"
        {
                YYCTYPE yych;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -395,9 +395,9 @@ state_plain:
                        goto yy15;
                }
                ++YYCURSOR;
-#line 287 "ext/standard/url_scanner_ex.re"
+#line 288 "url_scanner_ex.re"
                { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
-#line 401 "ext/standard/url_scanner_ex.c"
+#line 401 "url_scanner_ex.c"
 yy15:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -405,12 +405,12 @@ yy15:
                if(yybm[0+yych] & 128) {
                        goto yy15;
                }
-#line 288 "ext/standard/url_scanner_ex.re"
+#line 289 "url_scanner_ex.re"
                { passthru(STD_ARGS); goto state_plain; }
-#line 411 "ext/standard/url_scanner_ex.c"
+#line 411 "url_scanner_ex.c"
        }
 }
-#line 289 "ext/standard/url_scanner_ex.re"
+#line 290 "url_scanner_ex.re"
 
 
 state_tag:     
@@ -424,7 +424,7 @@ state_tag:
                  0,   0,   0,   0,   0,   0,   0,   0, 
                  0,   0,   0,   0,   0,   0,   0,   0, 
                  0,   0,   0,   0,   0,   0,   0,   0, 
-                 0,   0,   0,   0,   0,   0,   0,   0, 
+                 0,   0, 128,   0,   0,   0,   0,   0, 
                  0, 128, 128, 128, 128, 128, 128, 128, 
                128, 128, 128, 128, 128, 128, 128, 128, 
                128, 128, 128, 128, 128, 128, 128, 128, 
@@ -451,28 +451,31 @@ state_tag:
                  0,   0,   0,   0,   0,   0,   0,   0, 
        };
 
-#line 455 "ext/standard/url_scanner_ex.c"
+#line 455 "url_scanner_ex.c"
        {
                YYCTYPE yych;
                if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
                yych = *YYCURSOR;
-               if(yych <= '@') goto yy22;
-               if(yych <= 'Z') goto yy20;
-               if(yych <= '`') goto yy22;
-               if(yych >= '{') goto yy22;
+               if(yych <= '@') {
+                       if(yych != ':') goto yy22;
+               } else {
+                       if(yych <= 'Z') goto yy20;
+                       if(yych <= '`') goto yy22;
+                       if(yych >= '{') goto yy22;
+               }
 yy20:
                ++YYCURSOR;
                yych = *YYCURSOR;
                goto yy25;
 yy21:
-#line 294 "ext/standard/url_scanner_ex.re"
+#line 295 "url_scanner_ex.re"
                { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
-#line 471 "ext/standard/url_scanner_ex.c"
+#line 474 "url_scanner_ex.c"
 yy22:
                ++YYCURSOR;
-#line 295 "ext/standard/url_scanner_ex.re"
+#line 296 "url_scanner_ex.re"
                { passthru(STD_ARGS); goto state_plain_begin; }
-#line 476 "ext/standard/url_scanner_ex.c"
+#line 479 "url_scanner_ex.c"
 yy24:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -484,7 +487,7 @@ yy25:
                goto yy21;
        }
 }
-#line 296 "ext/standard/url_scanner_ex.re"
+#line 297 "url_scanner_ex.re"
 
 
 state_next_arg_begin:
@@ -528,7 +531,7 @@ state_next_arg:
                  0,   0,   0,   0,   0,   0,   0,   0, 
        };
 
-#line 532 "ext/standard/url_scanner_ex.c"
+#line 535 "url_scanner_ex.c"
        {
                YYCTYPE yych;
                if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -554,27 +557,27 @@ state_next_arg:
                        }
                }
                ++YYCURSOR;
-#line 304 "ext/standard/url_scanner_ex.re"
+#line 305 "url_scanner_ex.re"
                { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
-#line 560 "ext/standard/url_scanner_ex.c"
+#line 563 "url_scanner_ex.c"
 yy30:
                ++YYCURSOR;
                yych = *YYCURSOR;
                goto yy37;
 yy31:
-#line 305 "ext/standard/url_scanner_ex.re"
+#line 306 "url_scanner_ex.re"
                { passthru(STD_ARGS); goto state_next_arg; }
-#line 568 "ext/standard/url_scanner_ex.c"
+#line 571 "url_scanner_ex.c"
 yy32:
                ++YYCURSOR;
-#line 306 "ext/standard/url_scanner_ex.re"
+#line 307 "url_scanner_ex.re"
                { --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
-#line 573 "ext/standard/url_scanner_ex.c"
+#line 576 "url_scanner_ex.c"
 yy34:
                ++YYCURSOR;
-#line 307 "ext/standard/url_scanner_ex.re"
+#line 308 "url_scanner_ex.re"
                { passthru(STD_ARGS); goto state_plain_begin; }
-#line 578 "ext/standard/url_scanner_ex.c"
+#line 581 "url_scanner_ex.c"
 yy36:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -586,7 +589,7 @@ yy37:
                goto yy31;
        }
 }
-#line 308 "ext/standard/url_scanner_ex.re"
+#line 309 "url_scanner_ex.re"
 
 
 state_arg:
@@ -627,7 +630,7 @@ state_arg:
                  0,   0,   0,   0,   0,   0,   0,   0, 
        };
 
-#line 631 "ext/standard/url_scanner_ex.c"
+#line 634 "url_scanner_ex.c"
        {
                YYCTYPE yych;
                if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -641,14 +644,14 @@ yy40:
                yych = *YYCURSOR;
                goto yy45;
 yy41:
-#line 313 "ext/standard/url_scanner_ex.re"
+#line 314 "url_scanner_ex.re"
                { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
-#line 647 "ext/standard/url_scanner_ex.c"
+#line 650 "url_scanner_ex.c"
 yy42:
                ++YYCURSOR;
-#line 314 "ext/standard/url_scanner_ex.re"
+#line 315 "url_scanner_ex.re"
                { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
-#line 652 "ext/standard/url_scanner_ex.c"
+#line 655 "url_scanner_ex.c"
 yy44:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -660,7 +663,7 @@ yy45:
                goto yy41;
        }
 }
-#line 315 "ext/standard/url_scanner_ex.re"
+#line 316 "url_scanner_ex.re"
 
 
 state_before_val:
@@ -701,32 +704,30 @@ state_before_val:
                  0,   0,   0,   0,   0,   0,   0,   0, 
        };
 
-#line 705 "ext/standard/url_scanner_ex.c"
+#line 708 "url_scanner_ex.c"
        {
                YYCTYPE yych;
-               unsigned int yyaccept = 0;
                if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
                yych = *YYCURSOR;
                if(yych == ' ') goto yy48;
                if(yych == '=') goto yy50;
                goto yy52;
 yy48:
-               yyaccept = 0;
                yych = *(YYMARKER = ++YYCURSOR);
                if(yych == ' ') goto yy55;
                if(yych == '=') goto yy53;
 yy49:
-#line 321 "ext/standard/url_scanner_ex.re"
+#line 322 "url_scanner_ex.re"
                { --YYCURSOR; goto state_next_arg_begin; }
-#line 722 "ext/standard/url_scanner_ex.c"
+#line 723 "url_scanner_ex.c"
 yy50:
                ++YYCURSOR;
                yych = *YYCURSOR;
                goto yy54;
 yy51:
-#line 320 "ext/standard/url_scanner_ex.re"
+#line 321 "url_scanner_ex.re"
                { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
-#line 730 "ext/standard/url_scanner_ex.c"
+#line 731 "url_scanner_ex.c"
 yy52:
                yych = *++YYCURSOR;
                goto yy49;
@@ -746,12 +747,10 @@ yy55:
                if(yych == ' ') goto yy55;
                if(yych == '=') goto yy53;
                YYCURSOR = YYMARKER;
-               switch(yyaccept){
-               case 0: goto yy49;
-               }
+               goto yy49;
        }
 }
-#line 322 "ext/standard/url_scanner_ex.re"
+#line 323 "url_scanner_ex.re"
 
 
 
@@ -793,10 +792,9 @@ state_val:
                248, 248, 248, 248, 248, 248, 248, 248, 
        };
 
-#line 797 "ext/standard/url_scanner_ex.c"
+#line 796 "url_scanner_ex.c"
        {
                YYCTYPE yych;
-               unsigned int yyaccept = 0;
                if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
                yych = *YYCURSOR;
                if(yych <= ' ') {
@@ -818,15 +816,13 @@ state_val:
                                goto yy63;
                        }
                }
-               yyaccept = 0;
                yych = *(YYMARKER = ++YYCURSOR);
                goto yy77;
 yy61:
-#line 330 "ext/standard/url_scanner_ex.re"
+#line 331 "url_scanner_ex.re"
                { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
-#line 828 "ext/standard/url_scanner_ex.c"
+#line 825 "url_scanner_ex.c"
 yy62:
-               yyaccept = 0;
                yych = *(YYMARKER = ++YYCURSOR);
                goto yy69;
 yy63:
@@ -834,9 +830,9 @@ yy63:
                goto yy67;
 yy64:
                ++YYCURSOR;
-#line 331 "ext/standard/url_scanner_ex.re"
+#line 332 "url_scanner_ex.re"
                { passthru(STD_ARGS); goto state_next_arg_begin; }
-#line 840 "ext/standard/url_scanner_ex.c"
+#line 836 "url_scanner_ex.c"
 yy66:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -847,7 +843,6 @@ yy67:
                }
                goto yy61;
 yy68:
-               yyaccept = 0;
                YYMARKER = ++YYCURSOR;
                if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
                yych = *YYCURSOR;
@@ -862,9 +857,9 @@ yy69:
                        goto yy66;
                }
 yy71:
-#line 329 "ext/standard/url_scanner_ex.re"
+#line 330 "url_scanner_ex.re"
                { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
-#line 868 "ext/standard/url_scanner_ex.c"
+#line 863 "url_scanner_ex.c"
 yy72:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -875,14 +870,11 @@ yy72:
                if(yych <= '=') goto yy75;
 yy74:
                YYCURSOR = YYMARKER;
-               switch(yyaccept){
-               case 0: goto yy61;
-               }
+               goto yy61;
 yy75:
                yych = *++YYCURSOR;
                goto yy71;
 yy76:
-               yyaccept = 0;
                YYMARKER = ++YYCURSOR;
                if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
                yych = *YYCURSOR;
@@ -897,9 +889,9 @@ yy77:
                        goto yy66;
                }
 yy79:
-#line 328 "ext/standard/url_scanner_ex.re"
+#line 329 "url_scanner_ex.re"
                { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
-#line 903 "ext/standard/url_scanner_ex.c"
+#line 895 "url_scanner_ex.c"
 yy80:
                ++YYCURSOR;
                if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -913,7 +905,7 @@ yy80:
                goto yy79;
        }
 }
-#line 332 "ext/standard/url_scanner_ex.re"
+#line 333 "url_scanner_ex.re"
 
 
 stop:
index c079b808a9975068bc879fb55a3a65f447e53068..192a4db64eaffc2042ab881ab61c7510f9c11e71 100644 (file)
@@ -93,6 +93,7 @@ PHP_INI_END()
 any = [\000-\377];
 N = (any\[<]);
 alpha = [a-zA-Z];
+alphanamespace = [a-zA-Z:];
 alphadash = ([a-zA-Z] | "-");
 */
 
@@ -291,7 +292,7 @@ state_plain:
 state_tag:     
        start = YYCURSOR;
 /*!re2c
-  alpha      { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
+  alphanamespace+      { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
   any          { passthru(STD_ARGS); goto state_plain_begin; }
 */