summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-16 10:13:02 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-16 10:13:02 +0100
commitfd5a0b31640419ca63d1ddeaffd6d3cf2a741814 (patch)
treebfd17d84c5181d7b98d7d66f56573f4fc897e31c /ext/session
parent01fcdff3849c3691d9aaeaab735846ab6d8895ca (diff)
downloadphp-upstream/5.3.5.tar.gz
Imported Upstream version 5.3.5upstream/5.3.5
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/config.m43
-rw-r--r--ext/session/session.c6
-rw-r--r--ext/session/tests/001.phpt2
-rw-r--r--ext/session/tests/003.phpt2
-rw-r--r--ext/session/tests/004.phpt2
-rw-r--r--ext/session/tests/005.phpt2
-rw-r--r--ext/session/tests/006.phpt2
-rw-r--r--ext/session/tests/007.phpt4
-rw-r--r--ext/session/tests/008-php4.2.3.phpt2
-rw-r--r--ext/session/tests/009.phpt2
-rw-r--r--ext/session/tests/012.phpt2
-rw-r--r--ext/session/tests/013.phpt2
-rw-r--r--ext/session/tests/014.phpt2
-rw-r--r--ext/session/tests/019.phpt2
-rw-r--r--ext/session/tests/bug53141.phpt26
15 files changed, 44 insertions, 17 deletions
diff --git a/ext/session/config.m4 b/ext/session/config.m4
index 8a0d4c0f8..8e2cba26d 100644
--- a/ext/session/config.m4
+++ b/ext/session/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4 286445 2009-07-28 08:59:08Z tony2001 $
+dnl $Id: config.m4 305038 2010-11-02 20:51:02Z felipe $
dnl
PHP_ARG_ENABLE(session, whether to enable PHP sessions,
@@ -13,6 +13,7 @@ if test "$PHP_SESSION" != "no"; then
PHP_PREAD_TEST
PHP_NEW_EXTENSION(session, session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
PHP_ADD_EXTENSION_DEP(session, hash, true)
+ PHP_ADD_EXTENSION_DEP(session, spl)
PHP_SUBST(SESSION_SHARED_LIBADD)
PHP_INSTALL_HEADERS(ext/session, [php_session.h mod_files.h mod_user.h])
AC_DEFINE(HAVE_PHP_SESSION,1,[ ])
diff --git a/ext/session/session.c b/ext/session/session.c
index 095fc7d45..9d4905d88 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c 300296 2010-06-08 22:30:16Z pajoye $ */
+/* $Id: session.c 305034 2010-11-02 18:34:56Z felipe $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -403,9 +403,8 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
efree(buf);
if (PS(entropy_length) > 0) {
- unsigned char rbuf[2048];
-
#ifdef PHP_WIN32
+ unsigned char rbuf[2048];
size_t toread = PS(entropy_length);
if (php_win32_get_random_bytes(rbuf, (size_t) toread) == SUCCESS){
@@ -2283,6 +2282,7 @@ static PHP_MINFO_FUNCTION(session) /* {{{ */
static const zend_module_dep session_deps[] = { /* {{{ */
ZEND_MOD_OPTIONAL("hash")
+ ZEND_MOD_REQUIRED("spl")
{NULL, NULL, NULL}
};
/* }}} */
diff --git a/ext/session/tests/001.phpt b/ext/session/tests/001.phpt
index 19dff78e1..543eba713 100644
--- a/ext/session/tests/001.phpt
+++ b/ext/session/tests/001.phpt
@@ -31,7 +31,7 @@ print session_encode()."\n";
session_destroy();
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Deprecated: Function session_register() is deprecated in %s on line %d
diff --git a/ext/session/tests/003.phpt b/ext/session/tests/003.phpt
index 8a4e0027f..677a958e8 100644
--- a/ext/session/tests/003.phpt
+++ b/ext/session/tests/003.phpt
@@ -28,7 +28,7 @@ var_dump($baz);
var_dump($arr);
session_destroy();
--EXPECT--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
object(foo)#1 (2) {
["bar"]=>
string(2) "ok"
diff --git a/ext/session/tests/004.phpt b/ext/session/tests/004.phpt
index 2ff675e7c..3e6de2523 100644
--- a/ext/session/tests/004.phpt
+++ b/ext/session/tests/004.phpt
@@ -73,7 +73,7 @@ var_dump($arr);
session_destroy();
?>
--EXPECT--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
OPEN: PHPSESSID
READ: abtest
object(foo)#2 (2) {
diff --git a/ext/session/tests/005.phpt b/ext/session/tests/005.phpt
index 124f0a831..4e6682c86 100644
--- a/ext/session/tests/005.phpt
+++ b/ext/session/tests/005.phpt
@@ -85,7 +85,7 @@ var_dump($baz); var_dump($arr); var_dump($c);
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
OPEN: PHPSESSID
READ: abtest
object(foo)#2 (2) {
diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt
index 7c7af61b7..9ab28f65d 100644
--- a/ext/session/tests/006.phpt
+++ b/ext/session/tests/006.phpt
@@ -45,7 +45,7 @@ echo "values after session:\n";
var_dump($a,$b);
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
original values:
object(a)#%d (1) {
["test"]=>
diff --git a/ext/session/tests/007.phpt b/ext/session/tests/007.phpt
index 9531b3dd8..54768e2bd 100644
--- a/ext/session/tests/007.phpt
+++ b/ext/session/tests/007.phpt
@@ -50,9 +50,9 @@ var_dump($HTTP_SESSION_VARS);
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
-Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
Deprecated: Function session_register() is deprecated in %s on line %d
float(3.14)
diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt
index 4fe938fbc..1b26900c8 100644
--- a/ext/session/tests/008-php4.2.3.phpt
+++ b/ext/session/tests/008-php4.2.3.phpt
@@ -58,7 +58,7 @@ var_dump($HTTP_SESSION_VARS);
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
NULL
session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively
array(1) {
diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt
index 705a2758f..1a7e87ce0 100644
--- a/ext/session/tests/009.phpt
+++ b/ext/session/tests/009.phpt
@@ -43,7 +43,7 @@ var_dump($HTTP_SESSION_VARS);
session_destroy();
?>
--EXPECT--
-Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
array(0) {
}
array(1) {
diff --git a/ext/session/tests/012.phpt b/ext/session/tests/012.phpt
index 32aeb29c1..b52333a99 100644
--- a/ext/session/tests/012.phpt
+++ b/ext/session/tests/012.phpt
@@ -32,7 +32,7 @@ session_destroy();
print "I live\n";
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Deprecated: Function session_register() is deprecated in %s on line %d
I live
diff --git a/ext/session/tests/013.phpt b/ext/session/tests/013.phpt
index ad6c14e13..04322f9f1 100644
--- a/ext/session/tests/013.phpt
+++ b/ext/session/tests/013.phpt
@@ -24,5 +24,5 @@ session_destroy();
print "I live\n";
?>
--EXPECT--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
I live
diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt
index 4e77a7aef..be1119d9a 100644
--- a/ext/session/tests/014.phpt
+++ b/ext/session/tests/014.phpt
@@ -33,7 +33,7 @@ ini_set("session.use_trans_sid","1");
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
<a href="/link?PHPSESSID=abtest">
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d
diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt
index 5bdd03b5c..9c4f8caf9 100644
--- a/ext/session/tests/019.phpt
+++ b/ext/session/tests/019.phpt
@@ -47,7 +47,7 @@ var_dump($_SESSION);
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
+Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Deprecated: Function session_register() is deprecated in %s on line %d
array(2) {
diff --git a/ext/session/tests/bug53141.phpt b/ext/session/tests/bug53141.phpt
new file mode 100644
index 000000000..765d2727e
--- /dev/null
+++ b/ext/session/tests/bug53141.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #53141 (autoload misbehaves if called from closing session)
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+spl_autoload_register(function ($class) {
+ var_dump("Loading $class");
+ eval('class Bar {}');
+});
+
+class Foo
+{
+ function __sleep()
+ {
+ new Bar;
+ return array();
+ }
+}
+
+session_start();
+$_SESSION['foo'] = new Foo;
+
+?>
+--EXPECT--
+string(11) "Loading Bar" \ No newline at end of file