iliaa Tue Feb 28 14:45:52 2006 UTC Modified files: /php-src/ext/standard url_scanner_ex.c /php-src/ext/session/tests bug36459.phpt Log: MFB51: Fixed bug #36459 (Incorrect adding PHPSESSID to links, which contains \r\n).
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/url_scanner_ex.c?r1=1.99&r2=1.100&diff_format=u Index: php-src/ext/standard/url_scanner_ex.c diff -u php-src/ext/standard/url_scanner_ex.c:1.99 php-src/ext/standard/url_scanner_ex.c:1.100 --- php-src/ext/standard/url_scanner_ex.c:1.99 Sun Jan 1 13:09:56 2006 +++ php-src/ext/standard/url_scanner_ex.c Tue Feb 28 14:45:52 2006 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.11 on Sun Dec 18 21:50:56 2005 */ +/* Generated by re2c 0.9.11 on Tue Feb 28 09:45:27 2006 */ #line 1 "ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: url_scanner_ex.c,v 1.99 2006/01/01 13:09:56 sniper Exp $ */ +/* $Id: url_scanner_ex.c,v 1.100 2006/02/28 14:45:52 iliaa Exp $ */ #include "php.h" @@ -109,43 +109,8 @@ q = (p = url->c) + url->len; scan: -{ - static unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 128, 128, 128, 128, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; -#line 149 "ext/standard/url_scanner_ex.c" +#line 114 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; goto yy0; @@ -153,43 +118,42 @@ yy0: if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yybm[0+yych] & 128) { - goto yy8; + switch(yych){ + case '#': goto yy6; + case ':': goto yy2; + case '?': goto yy4; + default: goto yy8; } - if(yych <= '9') goto yy6; - if(yych >= ';') goto yy4; - goto yy2; yy2: ++YYCURSOR; goto yy3; yy3: #line 115 "ext/standard/url_scanner_ex.re" { smart_str_append(dest, url); return; } -#line 168 "ext/standard/url_scanner_ex.c" +#line 133 "ext/standard/url_scanner_ex.c" yy4: ++YYCURSOR; goto yy5; yy5: #line 116 "ext/standard/url_scanner_ex.re" { sep = separator; goto scan; } -#line 174 "ext/standard/url_scanner_ex.c" +#line 139 "ext/standard/url_scanner_ex.c" yy6: ++YYCURSOR; goto yy7; yy7: #line 117 "ext/standard/url_scanner_ex.re" { bash = p - 1; goto done; } -#line 180 "ext/standard/url_scanner_ex.c" +#line 145 "ext/standard/url_scanner_ex.c" yy8: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy9; -yy9: if(yybm[0+yych] & 128) { - goto yy8; +yy9: switch(yych){ + case '#': case ':': case '?': goto yy10; + default: goto yy8; } - goto yy10; yy10: #line 118 "ext/standard/url_scanner_ex.re" { goto scan; } -#line 192 "ext/standard/url_scanner_ex.c" -} +#line 157 "ext/standard/url_scanner_ex.c" } #line 119 "ext/standard/url_scanner_ex.re" @@ -359,43 +323,8 @@ state_plain: start = YYCURSOR; -{ - static unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 0, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; -#line 399 "ext/standard/url_scanner_ex.c" +#line 328 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; goto yy11; @@ -403,72 +332,36 @@ yy11: if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yybm[0+yych] & 128) { - goto yy15; + switch(yych){ + case '<': goto yy13; + default: goto yy15; } - goto yy13; yy13: ++YYCURSOR; goto yy14; yy14: #line 287 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } -#line 416 "ext/standard/url_scanner_ex.c" +#line 345 "ext/standard/url_scanner_ex.c" yy15: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy16; -yy16: if(yybm[0+yych] & 128) { - goto yy15; +yy16: switch(yych){ + case '<': goto yy17; + default: goto yy15; } - goto yy17; yy17: #line 288 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain; } -#line 428 "ext/standard/url_scanner_ex.c" -} +#line 357 "ext/standard/url_scanner_ex.c" } #line 289 "ext/standard/url_scanner_ex.re" state_tag: start = YYCURSOR; -{ - static unsigned char yybm[] = { - 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, 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, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 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, - 128, 128, 128, 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, 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, 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, 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, - }; -#line 472 "ext/standard/url_scanner_ex.c" +#line 365 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; goto yy18; @@ -476,33 +369,131 @@ yy18: 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; - goto yy20; + switch(yych){ + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy20; + default: goto yy22; + } yy20: ++YYCURSOR; yych = *YYCURSOR; goto yy25; yy21: #line 294 "ext/standard/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 491 "ext/standard/url_scanner_ex.c" +#line 433 "ext/standard/url_scanner_ex.c" yy22: ++YYCURSOR; goto yy23; yy23: #line 295 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } -#line 497 "ext/standard/url_scanner_ex.c" +#line 439 "ext/standard/url_scanner_ex.c" yy24: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy25; -yy25: if(yybm[0+yych] & 128) { - goto yy24; +yy25: switch(yych){ + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy24; + default: goto yy21; } - goto yy21; -} } #line 296 "ext/standard/url_scanner_ex.re" @@ -512,43 +503,8 @@ state_next_arg: start = YYCURSOR; -{ - static unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; -#line 552 "ext/standard/url_scanner_ex.c" +#line 508 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; goto yy26; @@ -556,102 +512,107 @@ yy26: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych <= '='){ - if(yych <= 0x0B){ - if(yych <= 0x08) goto yy34; - goto yy30; - } else { - if(yych == ' ') goto yy30; - goto yy34; - } - } else { - if(yych <= 'Z'){ - if(yych <= '>') goto yy28; - if(yych <= '@') goto yy34; - goto yy32; - } else { - if(yych <= '`') goto yy34; - if(yych <= 'z') goto yy32; - goto yy34; - } + switch(yych){ + case 0x09: + case 0x0A: + case 0x0B: case ' ': goto yy30; + case '>': goto yy28; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy32; + default: goto yy34; } yy28: ++YYCURSOR; goto yy29; yy29: #line 304 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } -#line 584 "ext/standard/url_scanner_ex.c" +#line 579 "ext/standard/url_scanner_ex.c" yy30: ++YYCURSOR; yych = *YYCURSOR; goto yy37; yy31: #line 305 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg; } -#line 591 "ext/standard/url_scanner_ex.c" +#line 586 "ext/standard/url_scanner_ex.c" yy32: ++YYCURSOR; goto yy33; yy33: #line 306 "ext/standard/url_scanner_ex.re" { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } -#line 597 "ext/standard/url_scanner_ex.c" +#line 592 "ext/standard/url_scanner_ex.c" yy34: ++YYCURSOR; goto yy35; yy35: #line 307 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } -#line 603 "ext/standard/url_scanner_ex.c" +#line 598 "ext/standard/url_scanner_ex.c" yy36: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy37; -yy37: if(yybm[0+yych] & 128) { - goto yy36; +yy37: switch(yych){ + case 0x09: + case 0x0A: + case 0x0B: case ' ': goto yy36; + default: goto yy31; } - goto yy31; -} } #line 308 "ext/standard/url_scanner_ex.re" state_arg: start = YYCURSOR; -{ - static unsigned char yybm[] = { - 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, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 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, - 128, 128, 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, - 128, 128, 128, 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, 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, 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, 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, - }; -#line 655 "ext/standard/url_scanner_ex.c" +#line 616 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; goto yy38; @@ -659,76 +620,139 @@ yy38: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych <= '@') goto yy42; - if(yych <= 'Z') goto yy40; - if(yych <= '`') goto yy42; - if(yych >= '{') goto yy42; - goto yy40; + switch(yych){ + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy40; + default: goto yy42; + } yy40: ++YYCURSOR; yych = *YYCURSOR; goto yy45; yy41: #line 313 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } -#line 674 "ext/standard/url_scanner_ex.c" +#line 684 "ext/standard/url_scanner_ex.c" yy42: ++YYCURSOR; goto yy43; yy43: #line 314 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -#line 680 "ext/standard/url_scanner_ex.c" +#line 690 "ext/standard/url_scanner_ex.c" yy44: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy45; -yy45: if(yybm[0+yych] & 128) { - goto yy44; +yy45: switch(yych){ + case '-': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy44; + default: goto yy41; } - goto yy41; -} } #line 315 "ext/standard/url_scanner_ex.re" state_before_val: start = YYCURSOR; -{ - static unsigned char yybm[] = { - 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; -#line 732 "ext/standard/url_scanner_ex.c" +#line 756 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -737,91 +761,61 @@ yy46: if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if(yych == ' ') goto yy48; - if(yych == '=') goto yy50; - goto yy52; + switch(yych){ + case ' ': goto yy48; + case '=': goto yy50; + default: goto yy52; + } yy48: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ' ') goto yy55; - if(yych == '=') goto yy53; - goto yy49; + switch(yych){ + case ' ': goto yy55; + case '=': goto yy53; + default: goto yy49; + } yy49: #line 321 "ext/standard/url_scanner_ex.re" { --YYCURSOR; goto state_next_arg_begin; } -#line 752 "ext/standard/url_scanner_ex.c" +#line 780 "ext/standard/url_scanner_ex.c" yy50: ++YYCURSOR; yych = *YYCURSOR; goto yy54; yy51: #line 320 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } -#line 759 "ext/standard/url_scanner_ex.c" +#line 787 "ext/standard/url_scanner_ex.c" yy52: yych = *++YYCURSOR; goto yy49; yy53: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy54; -yy54: if(yybm[0+yych] & 128) { - goto yy53; +yy54: switch(yych){ + case ' ': goto yy53; + default: goto yy51; } - goto yy51; yy55: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy56; -yy56: if(yych == ' ') goto yy55; - if(yych == '=') goto yy53; - goto yy57; +yy56: switch(yych){ + case ' ': goto yy55; + case '=': goto yy53; + default: goto yy57; + } yy57: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy49; } } -} #line 322 "ext/standard/url_scanner_ex.re" state_val: start = YYCURSOR; -{ - static unsigned char yybm[] = { - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 160, 160, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 160, 248, 56, 248, 248, 248, 248, 200, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 0, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - }; -#line 825 "ext/standard/url_scanner_ex.c" +#line 819 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -830,23 +824,12 @@ yy58: if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych <= 0x08) goto yy63; - goto yy64; - } else { - if(yych == ' ') goto yy64; - goto yy63; - } - } else { - if(yych <= '\''){ - if(yych <= '"') goto yy60; - if(yych <= '&') goto yy63; - goto yy62; - } else { - if(yych == '>') goto yy64; - goto yy63; - } + switch(yych){ + case 0x09: + case 0x0A: case ' ': case '>': goto yy64; + case '"': goto yy60; + case '\'': goto yy62; + default: goto yy63; } yy60: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -854,7 +837,7 @@ yy61: #line 330 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 0, '\0'); goto state_next_arg_begin; } -#line 858 "ext/standard/url_scanner_ex.c" +#line 841 "ext/standard/url_scanner_ex.c" yy62: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); goto yy69; @@ -865,45 +848,47 @@ yy65: #line 331 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg_begin; } -#line 869 "ext/standard/url_scanner_ex.c" +#line 852 "ext/standard/url_scanner_ex.c" yy66: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy67; -yy67: if(yybm[0+yych] & 8) { - goto yy66; +yy67: switch(yych){ + case 0x09: + case 0x0A: case ' ': case '>': goto yy61; + default: goto yy66; } - goto yy61; yy68: yyaccept = 0; YYMARKER = ++YYCURSOR; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; goto yy69; -yy69: if(yybm[0+yych] & 16) { - goto yy68; +yy69: switch(yych){ + case 0x09: + case 0x0A: case ' ': goto yy72; + case '\'': goto yy70; + case '>': goto yy61; + default: goto yy68; } - if(yych <= '&') goto yy72; - if(yych >= '(') goto yy61; - goto yy70; yy70: ++YYCURSOR; - if(yybm[0+(yych = *YYCURSOR)] & 8) { - yych = *YYCURSOR; - goto yy66; + switch((yych = *YYCURSOR)) { + case 0x09: + case 0x0A: case ' ': case '>': goto yy71; + default: goto yy66; } - goto yy71; yy71: #line 329 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -#line 898 "ext/standard/url_scanner_ex.c" +#line 883 "ext/standard/url_scanner_ex.c" yy72: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy73; -yy73: if(yybm[0+yych] & 32) { - goto yy72; +yy73: switch(yych){ + case '\'': goto yy75; + case '>': goto yy74; + default: goto yy72; } - if(yych <= '=') goto yy75; - goto yy74; yy74: YYCURSOR = YYMARKER; switch(yyaccept){ case 0: goto yy61; @@ -915,36 +900,36 @@ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; goto yy77; -yy77: if(yybm[0+yych] & 64) { - goto yy76; +yy77: switch(yych){ + case 0x09: + case 0x0A: case ' ': goto yy80; + case '"': goto yy78; + case '>': goto yy61; + default: goto yy76; } - if(yych <= '!') goto yy80; - if(yych >= '#') goto yy61; - goto yy78; yy78: ++YYCURSOR; - if(yybm[0+(yych = *YYCURSOR)] & 8) { - yych = *YYCURSOR; - goto yy66; + switch((yych = *YYCURSOR)) { + case 0x09: + case 0x0A: case ' ': case '>': goto yy79; + default: goto yy66; } - goto yy79; yy79: #line 328 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -#line 934 "ext/standard/url_scanner_ex.c" +#line 920 "ext/standard/url_scanner_ex.c" yy80: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; goto yy81; -yy81: if(yybm[0+yych] & 128) { - goto yy80; +yy81: switch(yych){ + case '"': goto yy82; + case '>': goto yy74; + default: goto yy80; } - if(yych >= '>') goto yy74; - goto yy82; yy82: ++YYCURSOR; yych = *YYCURSOR; goto yy79; } -} #line 332 "ext/standard/url_scanner_ex.re" http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/bug36459.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/session/tests/bug36459.phpt diff -u /dev/null php-src/ext/session/tests/bug36459.phpt:1.2 --- /dev/null Tue Feb 28 14:45:52 2006 +++ php-src/ext/session/tests/bug36459.phpt Tue Feb 28 14:45:52 2006 @@ -0,0 +1,41 @@ +--TEST-- +bug #31454 (Incorrect adding PHPSESSID to links, which contains \r\n) +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php +error_reporting(E_ALL); + +ini_set('session.use_trans_sid', 1); +ini_set('session.use_cookies', 0); +ini_set('session.name', 'sid'); + +session_start(); + +# Do not remove \r from this tests, they are essential! +?> +<html> + <head> + <title>Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n</title> + </head> + <body> + <p>See source html code</p> + <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2" + style="font: normal 11pt Times New Roman">incorrect link</a><br /> + <br /> + <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2" style="font: normal 11pt Times New Roman">correct link</a> + </body> +</html> +--EXPECTF-- +<html> + <head> + <title>Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n</title> + </head> + <body> + <p>See source html code</p> + <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2&sid=%s" + style="font: normal 11pt Times New Roman">incorrect link</a><br /> + <br /> + <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2&sid=%s" style="font: normal 11pt Times New Roman">correct link</a> + </body> +</html>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php