Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/session/mod_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ PS_CLOSE_FUNC(files)

zend_string_release_ex(data->basedir, /* persistent */ false);
efree(data);
PS_SET_MOD_DATA(NULL);
PS_SET_MOD_DATA(data);

return SUCCESS;
}
Expand Down
35 changes: 35 additions & 0 deletions ext/session/tests/sessionhandler_validateid_return_type.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--TEST--
SessionHandler::validateId must return bool
--INI--
session.use_strict_mode=1
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
class MySession extends SessionHandler {
public function validateId($key) {
return null;
}
}

$handler = new MySession();

try {
session_set_save_handler($handler);
session_start();
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}

session_write_close();

try {
session_start();
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Session id must be a string
Loading