1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/session/tests/bug73100.phpt
Gina Peter Banyard 1041a47ed3 ext/standard: throw ValueError if argument contains null byte in session_module_name()
And fix error message to use 'must not' rather than 'cannot'
2026-02-09 10:49:59 +00:00

29 lines
648 B
PHP

--TEST--
Bug #73100 (session_destroy null dereference in ps_files_path_create)
--EXTENSIONS--
session
--INI--
session.save_path=
session.save_handler=files
--FILE--
<?php
ob_start();
var_dump(session_start());
session_module_name("user");
var_dump(session_destroy());
try {
session_module_name("user");
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
===DONE===
--EXPECTF--
bool(true)
Warning: session_module_name(): Session save handler module cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(true)
session_module_name(): Argument #1 ($module) must not be "user"
===DONE===