summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-01-29 08:37:27 +0100
committerAnatol Belski <ab@php.net>2016-01-29 11:41:45 +0100
commit87a671bba08f482d05321d56edbb534501fea820 (patch)
tree00e66aa92237a064f0ed96667eb9d50a40fd7810
parenta6801092abb0fc72892177c3f96ab5f795759f35 (diff)
downloadphp-git-87a671bba08f482d05321d56edbb534501fea820.tar.gz
reset ext/session to the state of 7.0.2
-rw-r--r--ext/session/mod_user.c11
-rw-r--r--ext/session/mod_user_class.c27
-rw-r--r--ext/session/php_session.h2
-rw-r--r--ext/session/session.c53
-rw-r--r--ext/session/tests/016.phpt2
-rw-r--r--ext/session/tests/bug55688.phpt2
-rw-r--r--ext/session/tests/bug60634.phpt9
-rw-r--r--ext/session/tests/bug60634_error_1.phpt6
-rw-r--r--ext/session/tests/bug61728.phpt30
-rw-r--r--ext/session/tests/bug67972.phpt3
-rw-r--r--ext/session/tests/bug68063.phpt14
-rw-r--r--ext/session/tests/bug69111.phpt36
-rw-r--r--ext/session/tests/bug70133.phpt41
-rw-r--r--ext/session/tests/bug71186.phpt32
-rw-r--r--ext/session/tests/rfc1867_sid_invalid.phpt4
-rw-r--r--ext/session/tests/session_save_path_variation2.phpt8
-rw-r--r--ext/session/tests/session_save_path_variation3.phpt8
-rw-r--r--ext/session/tests/session_set_save_handler_class_002.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_class_005.phpt13
-rw-r--r--ext/session/tests/session_set_save_handler_class_012.phpt13
-rw-r--r--ext/session/tests/session_set_save_handler_class_016.phpt6
-rw-r--r--ext/session/tests/session_set_save_handler_class_017.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_error4.phpt5
-rw-r--r--ext/session/tests/session_set_save_handler_iface_001.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_iface_002.phpt2
-rw-r--r--ext/session/tests/sessionhandler_open_001.phpt7
26 files changed, 74 insertions, 266 deletions
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index c7c09ff781..e6f162855a 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -85,16 +85,7 @@ PS_OPEN_FUNC(user)
ZVAL_STRING(&args[0], (char*)save_path);
ZVAL_STRING(&args[1], (char*)session_name);
- zend_try {
- ps_call_handler(&PSF(open), 2, args, &retval);
- } zend_catch {
- PS(session_status) = php_session_none;
- if (!Z_ISUNDEF(retval)) {
- zval_ptr_dtor(&retval);
- }
- zend_bailout();
- } zend_end_try();
-
+ ps_call_handler(&PSF(open), 2, args, &retval);
PS(mod_user_implemented) = 1;
FINISH;
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index a774d4bf9c..59b44f5f6f 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -22,10 +22,6 @@
#include "php_session.h"
#define PS_SANITY_CHECK \
- if (PS(session_status) != php_session_active) { \
- php_error_docref(NULL, E_WARNING, "Session is not active"); \
- RETURN_FALSE; \
- } \
if (PS(default_mod) == NULL) { \
php_error_docref(NULL, E_CORE_ERROR, "Cannot call default session handler"); \
RETURN_FALSE; \
@@ -44,7 +40,6 @@ PHP_METHOD(SessionHandler, open)
{
char *save_path = NULL, *session_name = NULL;
size_t save_path_len, session_name_len;
- int ret;
PS_SANITY_CHECK;
@@ -53,15 +48,7 @@ PHP_METHOD(SessionHandler, open)
}
PS(mod_user_is_open) = 1;
-
- zend_try {
- ret = PS(default_mod)->s_open(&PS(mod_data), save_path, session_name);
- } zend_catch {
- PS(session_status) = php_session_none;
- zend_bailout();
- } zend_end_try();
-
- RETVAL_BOOL(SUCCESS == ret);
+ RETVAL_BOOL(SUCCESS == PS(default_mod)->s_open(&PS(mod_data), save_path, session_name));
}
/* }}} */
@@ -69,8 +56,6 @@ PHP_METHOD(SessionHandler, open)
Wraps the old close handler */
PHP_METHOD(SessionHandler, close)
{
- int ret;
-
PS_SANITY_CHECK_IS_OPEN;
// don't return on failure, since not closing the default handler
@@ -78,15 +63,7 @@ PHP_METHOD(SessionHandler, close)
zend_parse_parameters_none();
PS(mod_user_is_open) = 0;
-
- zend_try {
- ret = PS(default_mod)->s_close(&PS(mod_data));
- } zend_catch {
- PS(session_status) = php_session_none;
- zend_bailout();
- } zend_end_try();
-
- RETVAL_BOOL(SUCCESS == ret);
+ RETVAL_BOOL(SUCCESS == PS(default_mod)->s_close(&PS(mod_data)));
}
/* }}} */
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index b2ddef901d..ccd9b2c8f0 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -27,7 +27,7 @@
# include "ext/hash/php_hash.h"
#endif
-#define PHP_SESSION_API 20150121
+#define PHP_SESSION_API 20160121
#include "php_version.h"
#define PHP_SESSION_VERSION PHP_VERSION
diff --git a/ext/session/session.c b/ext/session/session.c
index fc91eda00b..52ba7e300a 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -97,13 +97,11 @@ zend_class_entry *php_session_update_timestamp_iface_entry;
#define APPLY_TRANS_SID (PS(use_trans_sid) && !PS(use_only_cookies))
static void php_session_send_cookie(void);
-static void php_session_abort(void);
/* Dispatched by RINIT and by php_session_destroy */
static inline void php_rinit_session_globals(void) /* {{{ */
{
/* Do NOT init PS(mod_user_names) here! */
- /* TODO: These could be moved to MINIT and removed. These should be initialized by php_rshutdown_session_globals() always when execution is finished. */
PS(id) = NULL;
PS(session_status) = php_session_none;
PS(mod_data) = NULL;
@@ -131,15 +129,10 @@ static inline void php_rshutdown_session_globals(void) /* {{{ */
zend_string_release(PS(id));
PS(id) = NULL;
}
-
if (PS(session_vars)) {
zend_string_release(PS(session_vars));
PS(session_vars) = NULL;
}
-
- /* User save handlers may end up directly here by misuse, bugs in user script, etc. */
- /* Set session status to prevent error while restoring save handler INI value. */
- PS(session_status) = php_session_none;
}
/* }}} */
@@ -510,10 +503,7 @@ static void php_session_initialize(void) /* {{{ */
{
zend_string *val = NULL;
- PS(session_status) = php_session_active;
-
if (!PS(mod)) {
- PS(session_status) = php_session_disabled;
php_error_docref(NULL, E_ERROR, "No storage module chosen - failed to initialize session");
return;
}
@@ -522,19 +512,14 @@ static void php_session_initialize(void) /* {{{ */
if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE
/* || PS(mod_data) == NULL */ /* FIXME: open must set valid PS(mod_data) with success */
) {
- php_session_abort();
php_error_docref(NULL, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
/* If there is no ID, use session module to create one */
- if (!PS(id) || !ZSTR_VAL(PS(id))[0]) {
- if (PS(id)) {
- zend_string_release(PS(id));
- }
+ if (!PS(id)) {
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
- php_session_abort();
php_error_docref(NULL, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
@@ -556,6 +541,7 @@ static void php_session_initialize(void) /* {{{ */
}
php_session_reset_id();
+ PS(session_status) = php_session_active;
/* GC must be done before read */
php_session_gc();
@@ -563,11 +549,11 @@ static void php_session_initialize(void) /* {{{ */
/* Read data */
php_session_track_init();
if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, PS(gc_maxlifetime)) == FAILURE) {
- php_session_abort();
/* Some broken save handler implementation returns FAILURE for non-existent session ID */
/* It's better to raise error for this, but disabled error for better compatibility */
- php_error_docref(NULL, E_WARNING, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
- return;
+ /*
+ php_error_docref(NULL, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ */
}
if (PS(session_vars)) {
zend_string_release(PS(session_vars));
@@ -1116,7 +1102,7 @@ static ps_serializer ps_serializers[MAX_SERIALIZERS + 1] = {
PHPAPI int php_session_register_serializer(const char *name, zend_string *(*encode)(PS_SERIALIZER_ENCODE_ARGS), int (*decode)(PS_SERIALIZER_DECODE_ARGS)) /* {{{ */
{
- int ret = FAILURE;
+ int ret = -1;
int i;
for (i = 0; i < MAX_SERIALIZERS; i++) {
@@ -1125,7 +1111,7 @@ PHPAPI int php_session_register_serializer(const char *name, zend_string *(*enco
ps_serializers[i].encode = encode;
ps_serializers[i].decode = decode;
ps_serializers[i + 1].name = NULL;
- ret = SUCCESS;
+ ret = 0;
break;
}
}
@@ -1147,13 +1133,13 @@ static ps_module *ps_modules[MAX_MODULES + 1] = {
PHPAPI int php_session_register_module(ps_module *ptr) /* {{{ */
{
- int ret = FAILURE;
+ int ret = -1;
int i;
for (i = 0; i < MAX_MODULES; i++) {
if (!ps_modules[i]) {
ps_modules[i] = ptr;
- ret = SUCCESS;
+ ret = 0;
break;
}
}
@@ -1302,13 +1288,11 @@ static int php_session_cache_limiter(void) /* {{{ */
php_session_cache_limiter_t *lim;
if (PS(cache_limiter)[0] == '\0') return 0;
- if (PS(session_status) != php_session_active) return -1;
if (SG(headers_sent)) {
const char *output_start_filename = php_output_get_start_filename();
int output_start_lineno = php_output_get_start_lineno();
- php_session_abort();
if (output_start_filename) {
php_error_docref(NULL, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", output_start_filename, output_start_lineno);
} else {
@@ -1668,8 +1652,8 @@ PHPAPI void php_session_start(void) /* {{{ */
static void php_session_flush(int write) /* {{{ */
{
if (PS(session_status) == php_session_active) {
- php_session_save_current_state(write);
PS(session_status) = php_session_none;
+ php_session_save_current_state(write);
}
}
/* }}} */
@@ -1677,10 +1661,10 @@ static void php_session_flush(int write) /* {{{ */
static void php_session_abort(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
+ PS(session_status) = php_session_none;
if (PS(mod_data) || PS(mod_user_implemented)) {
PS(mod)->s_close(&PS(mod_data));
}
- PS(session_status) = php_session_none;
}
}
/* }}} */
@@ -2055,13 +2039,13 @@ static PHP_FUNCTION(session_regenerate_id)
return;
}
- if (PS(session_status) != php_session_active) {
- php_error_docref(NULL, E_WARNING, "Cannot regenerate session id - session is not active");
+ if (SG(headers_sent) && PS(use_cookies)) {
+ php_error_docref(NULL, E_WARNING, "Cannot regenerate session id - headers already sent");
RETURN_FALSE;
}
- if (SG(headers_sent) && PS(use_cookies)) {
- php_error_docref(NULL, E_WARNING, "Cannot regenerate session id - headers already sent");
+ if (PS(session_status) != php_session_active) {
+ php_error_docref(NULL, E_WARNING, "Cannot regenerate session id - session is not active");
RETURN_FALSE;
}
@@ -2113,7 +2097,6 @@ static PHP_FUNCTION(session_regenerate_id)
zend_string_release(PS(id));
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
- PS(mod)->s_close(&PS(mod_data));
PS(session_status) = php_session_none;
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create session ID by collision: %s (path: %s)", PS(mod)->s_name, PS(save_path));
RETURN_FALSE;
@@ -2121,7 +2104,6 @@ static PHP_FUNCTION(session_regenerate_id)
}
/* Read is required to make new session data at this point. */
if (PS(mod)->s_read(&PS(mod_data), PS(id), &data, PS(gc_maxlifetime)) == FAILURE) {
- PS(mod)->s_close(&PS(mod_data));
PS(session_status) = php_session_none;
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create(read) session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
RETURN_FALSE;
@@ -2293,6 +2275,11 @@ static PHP_FUNCTION(session_start)
RETURN_FALSE;
}
+ if (PS(id) && !(ZSTR_LEN(PS(id)))) {
+ php_error_docref(NULL, E_WARNING, "Cannot start session with empty session ID");
+ RETURN_FALSE;
+ }
+
/* set options */
if (options) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(options), num_idx, str_idx, value) {
diff --git a/ext/session/tests/016.phpt b/ext/session/tests/016.phpt
index f23605eb47..82a85d2705 100644
--- a/ext/session/tests/016.phpt
+++ b/ext/session/tests/016.phpt
@@ -22,5 +22,5 @@ session_write_close();
print "I live\n";
?>
--EXPECTF--
-Warning: session_start(): Failed to read session data: files (path: 123;:/really%scompletely:::/invalid;;,23123;213) in %s on line %d
+Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (123;:/really%scompletely:::/invalid;;,23123;213) in %s on line %d
I live
diff --git a/ext/session/tests/bug55688.phpt b/ext/session/tests/bug55688.phpt
index b073dc3c5c..8db48384af 100644
--- a/ext/session/tests/bug55688.phpt
+++ b/ext/session/tests/bug55688.phpt
@@ -12,4 +12,4 @@ $x = new SessionHandler;
$x->gc(1);
?>
--EXPECTF--
-Warning: SessionHandler::gc(): Session is not active in %s on line %d
+Warning: SessionHandler::gc(): Parent session handler is not open in %s on line %d
diff --git a/ext/session/tests/bug60634.phpt b/ext/session/tests/bug60634.phpt
index b2f5076287..86dcb11526 100644
--- a/ext/session/tests/bug60634.phpt
+++ b/ext/session/tests/bug60634.phpt
@@ -39,17 +39,8 @@ session_start();
session_write_close();
echo "um, hi\n";
-/*
-FIXME: Since session module try to write/close session data in
-RSHUTDOWN, write() is executed twices. This is caused by undefined
-function error and zend_bailout(). Current session module codes
-depends on this behavior. These codes should be modified to remove
-multiple write().
-*/
-
?>
--EXPECTF--
write: goodbye cruel world
-write: goodbye cruel world
close: goodbye cruel world
diff --git a/ext/session/tests/bug60634_error_1.phpt b/ext/session/tests/bug60634_error_1.phpt
index fa76ff522a..d0733f5a5a 100644
--- a/ext/session/tests/bug60634_error_1.phpt
+++ b/ext/session/tests/bug60634_error_1.phpt
@@ -41,11 +41,6 @@ session_start();
session_write_close();
echo "um, hi\n";
-/*
-FIXME: Something wrong. It should try to close after error, otherwise session
-may keep "open" state.
-*/
-
?>
--EXPECTF--
write: goodbye cruel world
@@ -56,4 +51,3 @@ Stack trace:
#1 %s(%d): session_write_close()
#2 {main}
thrown in %s on line %d
-
diff --git a/ext/session/tests/bug61728.phpt b/ext/session/tests/bug61728.phpt
index 2780d7b7e2..3f8dbeb58a 100644
--- a/ext/session/tests/bug61728.phpt
+++ b/ext/session/tests/bug61728.phpt
@@ -8,34 +8,32 @@ function output_html($ext) {
return strlen($ext);
}
-function open ($save_path, $session_name) {
+function open ($save_path, $session_name) {
return true;
-}
+}
-function close() {
+function close() {
return true;
-}
+}
-function read ($id) {
- return '';
-}
+function read ($id) {
+}
-function write ($id, $sess_data) {
+function write ($id, $sess_data) {
ob_start("output_html");
echo "laruence";
ob_end_flush();
return true;
-}
+}
-function destroy ($id) {
- return true;
-}
+function destroy ($id) {
+}
-function gc ($maxlifetime) {
- return true;
-}
+function gc ($maxlifetime) {
+ return true;
+}
-session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
+session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
session_start();
--EXPECTF--
8
diff --git a/ext/session/tests/bug67972.phpt b/ext/session/tests/bug67972.phpt
index 92c3044ac5..63ed3a95b8 100644
--- a/ext/session/tests/bug67972.phpt
+++ b/ext/session/tests/bug67972.phpt
@@ -7,5 +7,4 @@ Bug #67972: SessionHandler Invalid memory read create_sid()
(new SessionHandler)->create_sid();
--EXPECTF--
-Warning: SessionHandler::create_sid(): Session is not active in %s on line %d
-
+Fatal error: SessionHandler::create_sid(): Cannot call default session handler in %s on line %d
diff --git a/ext/session/tests/bug68063.phpt b/ext/session/tests/bug68063.phpt
index ec3a70d156..d3da470d06 100644
--- a/ext/session/tests/bug68063.phpt
+++ b/ext/session/tests/bug68063.phpt
@@ -3,22 +3,18 @@ Bug #68063 (Empty session IDs do still start sessions)
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
-session.use_strict_mode=0
-session.hash_function=1
-session.hash_bits_per_character=4
--FILE--
<?php
-// Empty session ID may happen by browser bugs
-
// Could also be set with a cookie like "PHPSESSID=; path=/"
session_id('');
-// Start the session with empty string should result in new session ID
+// Will still start the session and return true
var_dump(session_start());
-// Returns newly created session ID
+// Returns an empty string
var_dump(session_id());
?>
--EXPECTF--
-bool(true)
-string(40) "%s"
+Warning: session_start(): Cannot start session with empty session ID in %s on line %d
+bool(false)
+string(0) ""
diff --git a/ext/session/tests/bug69111.phpt b/ext/session/tests/bug69111.phpt
deleted file mode 100644
index f5def0ed35..0000000000
--- a/ext/session/tests/bug69111.phpt
+++ /dev/null
@@ -1,36 +0,0 @@
---TEST--
-Bug #69111 (Crash in SessionHandler::read())
---INI--
-session.save_path=
-session.save_handler=files
-session.name=PHPSESSID
---SKIPIF--
-<?php include('skipif.inc'); ?>
---FILE--
-<?php
-$sh = new SessionHandler;
-session_set_save_handler($sh);
-
-$savePath = ini_get('session.save_path');
-$sessionName = ini_get('session.name');
-
-// session_start(); // Uncommenting this makes it not crash when reading the session (see below), but it will not return any data.
-
-$sh->open($savePath, $sessionName);
-$sh->write("foo", "bar");
-$sh->read($id);
-$sh->gc(1245);
-$sh->close();
-?>
---EXPECTF--
-Warning: SessionHandler::open(): Session is not active in %s on line 10
-
-Warning: SessionHandler::write(): Session is not active in %s on line 11
-
-Notice: Undefined variable: id in %s on line 12
-
-Warning: SessionHandler::read(): Session is not active in %s on line 12
-
-Warning: SessionHandler::gc(): Session is not active in %s on line 13
-
-Warning: SessionHandler::close(): Session is not active in %s on line 14 \ No newline at end of file
diff --git a/ext/session/tests/bug70133.phpt b/ext/session/tests/bug70133.phpt
deleted file mode 100644
index 3e019e483b..0000000000
--- a/ext/session/tests/bug70133.phpt
+++ /dev/null
@@ -1,41 +0,0 @@
---TEST--
-Bug #70133 (Extended SessionHandler::read is ignoring $session_id when calling parent)
---SKIPIF--
-<?php include('skipif.inc'); ?>
---INI--
-session.save_handler=files
-session.save_path=
-session.use_strict_mode=0
---FILE--
-<?php
-
-class CustomReadHandler extends \SessionHandler {
-
- public function read($session_id) {
- return parent::read('mycustomsession');
- }
-}
-
-ob_start();
-
-session_set_save_handler(new CustomReadHandler(), true);
-
-session_id('mycustomsession');
-session_start();
-$_SESSION['foo'] = 'hoge';
-var_dump(session_id());
-session_commit();
-
-session_id('otherid');
-session_start();
-var_dump($_SESSION);
-var_dump(session_id());
-
-?>
---EXPECT--
-string(15) "mycustomsession"
-array(1) {
- ["foo"]=>
- string(4) "hoge"
-}
-string(7) "otherid"
diff --git a/ext/session/tests/bug71186.phpt b/ext/session/tests/bug71186.phpt
deleted file mode 100644
index 5eeba6035f..0000000000
--- a/ext/session/tests/bug71186.phpt
+++ /dev/null
@@ -1,32 +0,0 @@
---TEST--
-Bug #71186 session.hash_function - algorithm changes
---SKIPIF--
-<?php include('skipif.inc'); ?>
---INI--
-session.hash_function=sha512
-session.save_handler=files
---FILE--
-<?php
-ob_start();
-ini_set('session.use_strict_mode', 1);
-
-session_start();
-$orig = session_id();
-session_regenerate_id();
-$new = session_id();
-var_dump(strlen($orig),strlen($new));
-session_commit();
-
-ini_set('session.hash_function','sha1');
-session_id('invalid');
-session_start();
-$orig = session_id();
-session_regenerate_id();
-$new = session_id();
-var_dump(strlen($orig),strlen($new));
-?>
---EXPECT--
-int(128)
-int(128)
-int(40)
-int(40)
diff --git a/ext/session/tests/rfc1867_sid_invalid.phpt b/ext/session/tests/rfc1867_sid_invalid.phpt
index a9114e3e1d..4dd8f1f979 100644
--- a/ext/session/tests/rfc1867_sid_invalid.phpt
+++ b/ext/session/tests/rfc1867_sid_invalid.phpt
@@ -47,13 +47,13 @@ session_destroy();
--EXPECTF--
Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
-Warning: Unknown: Failed to read session data: files (path: ) in Unknown on line 0
+Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
-Warning: Unknown: Failed to read session data: files (path: ) in Unknown on line 0
+Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
string(%d) "%s"
diff --git a/ext/session/tests/session_save_path_variation2.phpt b/ext/session/tests/session_save_path_variation2.phpt
index 60675aec3c..4cf44b75a4 100644
--- a/ext/session/tests/session_save_path_variation2.phpt
+++ b/ext/session/tests/session_save_path_variation2.phpt
@@ -33,12 +33,8 @@ ob_end_flush();
string(5) "/blah"
Warning: session_start(): open(%sblah%e%s, O_RDWR) failed: No such file or directory (2) in %s on line %d
-
-Warning: session_start(): Failed to read session data: files (path: %sblah) in %s on line %d
-bool(false)
+bool(true)
string(5) "/blah"
-
-Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
-bool(false)
+bool(true)
string(5) "/blah"
Done
diff --git a/ext/session/tests/session_save_path_variation3.phpt b/ext/session/tests/session_save_path_variation3.phpt
index 1d290d95b3..b064f30183 100644
--- a/ext/session/tests/session_save_path_variation3.phpt
+++ b/ext/session/tests/session_save_path_variation3.phpt
@@ -33,12 +33,8 @@ ob_end_flush();
string(5) "/blah"
Warning: session_start(): open(%s, O_RDWR) failed: No such file or directory (2) in %s on line %d
-
-Warning: session_start(): Failed to read session data: files (path: %sblah) in %s on line %d
-bool(false)
+bool(true)
string(5) "/blah"
-
-Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
-bool(false)
+bool(true)
string(5) "/blah"
Done
diff --git a/ext/session/tests/session_set_save_handler_class_002.phpt b/ext/session/tests/session_set_save_handler_class_002.phpt
index 880bc33425..b75a7e6390 100644
--- a/ext/session/tests/session_set_save_handler_class_002.phpt
+++ b/ext/session/tests/session_set_save_handler_class_002.phpt
@@ -34,7 +34,7 @@ class MySession2 extends SessionHandler {
}
public function read($id) {
- return (string)@file_get_contents($this->path . $id);
+ return @file_get_contents($this->path . $id);
}
public function write($id, $data) {
diff --git a/ext/session/tests/session_set_save_handler_class_005.phpt b/ext/session/tests/session_set_save_handler_class_005.phpt
index 1b8c1ce645..5be735306a 100644
--- a/ext/session/tests/session_set_save_handler_class_005.phpt
+++ b/ext/session/tests/session_set_save_handler_class_005.phpt
@@ -33,7 +33,7 @@ class MySession6 extends SessionHandler {
$handler = new MySession6;
session_set_save_handler($handler);
-var_dump(session_start());
+session_start();
var_dump(session_id(), ini_get('session.save_handler'), $_SESSION);
@@ -45,12 +45,13 @@ session_unset();
*** Testing session_set_save_handler() : incomplete implementation ***
Warning: SessionHandler::read(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
-
-Warning: SessionHandler::close(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
-
-Warning: session_start(): Failed to read session data: user (%s) in %ssession_set_save_handler_class_005.php on line %d
-bool(false)
string(%d) "%s"
string(4) "user"
array(0) {
}
+
+Warning: SessionHandler::write(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
+
+Warning: session_write_close(): Failed to write session data %s in %ssession_set_save_handler_class_005.php on line %d
+
+Warning: SessionHandler::close(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt
index 0ce03f865e..91e751bdfc 100644
--- a/ext/session/tests/session_set_save_handler_class_012.phpt
+++ b/ext/session/tests/session_set_save_handler_class_012.phpt
@@ -38,7 +38,7 @@ class MySession extends SessionHandler {
$oldHandler = ini_get('session.save_handler');
$handler = new MySession;
session_set_save_handler($handler);
-var_dump(session_start());
+session_start();
var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION);
@@ -50,14 +50,15 @@ Warning: SessionHandler::open() expects exactly 2 parameters, 0 given in %s on l
Read %s
Warning: SessionHandler::read(): Parent session handler is not open in %s on line %d
-
-Warning: SessionHandler::close(): Parent session handler is not open in %s on line %d
-
-Warning: session_start(): Failed to read session data: user (%s) in %s on line %d
-bool(false)
string(%d) "%s"
string(5) "files"
string(4) "user"
int(2)
array(0) {
}
+
+Warning: SessionHandler::write(): Parent session handler is not open in Unknown on line 0
+
+Warning: session_write_close(): Failed to write session data %s in %s on line %d
+
+Warning: SessionHandler::close(): Parent session handler is not open in Unknown on line 0
diff --git a/ext/session/tests/session_set_save_handler_class_016.phpt b/ext/session/tests/session_set_save_handler_class_016.phpt
index 4095813c9d..521bd86f31 100644
--- a/ext/session/tests/session_set_save_handler_class_016.phpt
+++ b/ext/session/tests/session_set_save_handler_class_016.phpt
@@ -10,10 +10,10 @@ session.name=PHPSESSID
ob_start();
-/*
+/*
* Prototype : bool session_set_save_handler(SessionHandlerInterface $handler [, bool $register_shutdown_function = true])
* Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
+ * Source code : ext/session/session.c
*/
echo "*** Testing session_set_save_handler() function: class with create_sid ***\n";
@@ -34,7 +34,7 @@ class MySession2 extends SessionHandler {
}
public function read($id) {
- return (string)@file_get_contents($this->path . $id);
+ return @file_get_contents($this->path . $id);
}
public function write($id, $data) {
diff --git a/ext/session/tests/session_set_save_handler_class_017.phpt b/ext/session/tests/session_set_save_handler_class_017.phpt
index b8e7d7a7ad..6f42d7809a 100644
--- a/ext/session/tests/session_set_save_handler_class_017.phpt
+++ b/ext/session/tests/session_set_save_handler_class_017.phpt
@@ -34,7 +34,7 @@ class MySession2 extends SessionHandler {
}
public function read($id) {
- return (string)@file_get_contents($this->path . $id);
+ return @file_get_contents($this->path . $id);
}
public function write($id, $data) {
diff --git a/ext/session/tests/session_set_save_handler_error4.phpt b/ext/session/tests/session_set_save_handler_error4.phpt
index 4267195ee1..be3429b084 100644
--- a/ext/session/tests/session_set_save_handler_error4.phpt
+++ b/ext/session/tests/session_set_save_handler_error4.phpt
@@ -24,7 +24,7 @@ session_set_save_handler("callback", "callback", "callback", "echo", "callback",
session_set_save_handler("callback", "callback", "callback", "callback", "echo", "callback");
session_set_save_handler("callback", "callback", "callback", "callback", "callback", "echo");
session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback");
-var_dump(session_start());
+session_start();
ob_end_flush();
?>
--EXPECTF--
@@ -39,6 +39,3 @@ Warning: session_set_save_handler(): Argument 4 is not a valid callback in %s on
Warning: session_set_save_handler(): Argument 5 is not a valid callback in %s on line %d
Warning: session_set_save_handler(): Argument 6 is not a valid callback in %s on line %d
-
-Warning: session_start(): Failed to read session data: user (%s) in %s on line %d
-bool(false)
diff --git a/ext/session/tests/session_set_save_handler_iface_001.phpt b/ext/session/tests/session_set_save_handler_iface_001.phpt
index 6943d59cbe..03ee42865c 100644
--- a/ext/session/tests/session_set_save_handler_iface_001.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_001.phpt
@@ -34,7 +34,7 @@ class MySession2 implements SessionHandlerInterface {
}
public function read($id) {
- return (string)@file_get_contents($this->path . $id);
+ return @file_get_contents($this->path . $id);
}
public function write($id, $data) {
diff --git a/ext/session/tests/session_set_save_handler_iface_002.phpt b/ext/session/tests/session_set_save_handler_iface_002.phpt
index 204d88c785..40c9ac6825 100644
--- a/ext/session/tests/session_set_save_handler_iface_002.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_002.phpt
@@ -43,7 +43,7 @@ class MySession2 implements MySessionHandlerInterface {
}
public function read($id) {
- return (string)@file_get_contents($this->path . $id);
+ return @file_get_contents($this->path . $id);
}
public function write($id, $data) {
diff --git a/ext/session/tests/sessionhandler_open_001.phpt b/ext/session/tests/sessionhandler_open_001.phpt
index e6e913a6a5..6ade9e00a5 100644
--- a/ext/session/tests/sessionhandler_open_001.phpt
+++ b/ext/session/tests/sessionhandler_open_001.phpt
@@ -16,11 +16,4 @@ print "Done!\n";
?>
--EXPECTF--
-Warning: SessionHandler::open(): Session is not active in %s on line 5
-
-Warning: SessionHandler::open(): Session is not active in %s on line 6
-
-Warning: SessionHandler::open(): Session is not active in %s on line 7
-
-Warning: SessionHandler::open(): Session is not active in %s on line 8
Done!