[php-src] master: ext/session: remove test made unreachable by cookie attribute validation (#24325)
| From: | Jorg Adam Sowa via GitHub | Date: | Wed, 14 Oct 2026 15:24:54 +0000 |
| Subject: | [php-src] master: ext/session: remove test made unreachable by cookie attribute validation (#24325) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142269@lists.php.net to get a copy of this message | ||
Author: Jorg Adam Sowa (jorgsowa)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-10-14T16:24:50+01:00
Commit: https://github.com/php/php-src/commit/cb491daca35fe8e0177d60b4e163218c4ec97b2a
Raw diff: https://github.com/php/php-src/commit/cb491daca35fe8e0177d60b4e163218c4ec97b2a.diff
ext/session: remove test made unreachable by cookie attribute validation (#24325)
session_start_cookie_header_rejected.phpt injected a newline through
session.cookie_path to make the SAPI reject the Set-Cookie header.
Since b9a0228bd84 session.cookie_path and session.cookie_domain reject
CR/LF up front, so no userland input can reach that branch any more
and the test failed.
Changed paths:
D ext/session/tests/session_start_cookie_header_rejected.phpt
Diff:
diff --git a/ext/session/tests/session_start_cookie_header_rejected.phpt
b/ext/session/tests/session_start_cookie_header_rejected.phpt
deleted file mode 100644
index 6c3e3b78a3b5..000000000000
--- a/ext/session/tests/session_start_cookie_header_rejected.phpt
+++ /dev/null
@@ -1,28 +0,0 @@
---TEST--
-session_start() when the SAPI rejects the session cookie header
---INI--
-session.save_handler=files
-session.name=PHPSESSID
-session.gc_probability=0
---EXTENSIONS--
-session
---FILE--
-<?php
-
-ob_start();
-
-set_error_handler(function (int $errno, string $errstr): bool {
- echo "handler: ", $errstr, PHP_EOL;
- return true;
-});
-
-session_set_cookie_params(['path' => "/\r\nX-Injected: yes"]);
-
-var_dump(session_start());
-var_dump(session_status() === PHP_SESSION_NONE);
-
-?>
---EXPECT--
-handler: Header may not contain more than a single header, new line detected
-bool(false)
-bool(true)