Skip to content

Commit b80d73c

Browse files
committed
fix crash, enable session_id and fix test
1 parent 82b0e8b commit b80d73c

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

ext/session/mod_files.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ PS_CREATE_SID_FUNC(files)
465465
do {
466466
sid = php_session_create_id((void **)&data, newlen TSRMLS_CC);
467467
/* Check collision */
468-
if (ps_files_key_exists(data, sid TSRMLS_CC) == SUCCESS) {
468+
if (data && ps_files_key_exists(data, sid TSRMLS_CC) == SUCCESS) {
469469
if (sid) {
470470
efree(sid);
471471
sid = NULL;

ext/session/session.c

-3
Original file line numberDiff line numberDiff line change
@@ -1829,9 +1829,6 @@ static PHP_FUNCTION(session_id)
18291829
}
18301830

18311831
if (name) {
1832-
if (PS(use_strict_mode) && argc) {
1833-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set session ID while session.use_strict_mode is enabled");
1834-
}
18351832
if (PS(id)) {
18361833
efree(PS(id));
18371834
}

ext/session/tests/session_save_path_variation5.phpt

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN")
99
session.save_handler=files
1010
session.save_path=
1111
session.name=PHPSESSID
12-
open_basedir=.
1312
--FILE--
1413
<?php
1514

@@ -25,7 +24,7 @@ $directory = dirname(__FILE__);
2524
$sessions = ($directory."/sessions");
2625

2726
chdir($directory);
28-
27+
ini_set('open_basedir', '.');
2928
// Delete the existing directory
3029
if (file_exists($sessions) === TRUE) {
3130
@rmdir($sessions);

0 commit comments

Comments
 (0)