Fixed bug #36459 (Incorrect adding PHPSESSID to links, which contains \r\n).

This commit is contained in:
Ilia Alshanetsky 2006-02-28 14:45:18 +00:00
parent 477f503b9e
commit 3022080d84
4 changed files with 420 additions and 392 deletions

2
NEWS
View File

@ -38,6 +38,8 @@ PHP NEWS
- Fixed crash with DOMImplementation::createDocumentType("name:"). (Mike)
- Fixed bug #36510 (strtotime() fails to parse date strings with tabs). (Ilia,
Derick)
- Fixed bug #36459 (Incorrect adding PHPSESSID to links, which contains \r\n).
(Ilia)
- Fixed bug #36458 (sleep() accepts negative values). (Ilia)
- Fixed bug #36436 (DBA problem with Berkeley DB4). (Marcus)
- Fixed bug #36434 (Improper resolution of declaring class name of an inherited

View File

@ -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>

File diff suppressed because it is too large Load Diff

View File

@ -302,7 +302,7 @@ state_next_arg:
start = YYCURSOR;
/*!re2c
">" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
[ \v\t\n]+ { passthru(STD_ARGS); goto state_next_arg; }
[ \v\r\t\n]+ { passthru(STD_ARGS); goto state_next_arg; }
alpha { --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
any { passthru(STD_ARGS); goto state_plain_begin; }
*/
@ -327,7 +327,7 @@ state_val:
/*!re2c
["] (any\[">])* ["] { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
['] (any\['>])* ['] { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
(any\[ \t\n>])+ { handle_val(STD_ARGS, 0, '\0'); goto state_next_arg_begin; }
(any\[ \r\t\n>])+ { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
any { passthru(STD_ARGS); goto state_next_arg_begin; }
*/