summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-11-02 18:34:56 +0000
committerFelipe Pena <felipe@php.net>2010-11-02 18:34:56 +0000
commit7ded7577b21e9ff4443b48c24ac0f0d543424676 (patch)
tree224e40f8cb63af4dbed27975e5d2a6a51729614c
parenta1632696a8730e3102e0e4fa92213b39807daa2f (diff)
downloadphp-git-7ded7577b21e9ff4443b48c24ac0f0d543424676.tar.gz
- Fixed bug #53141 (autoload misbehaves if called from closing session)
patch by: ladislav at marek dot su
-rw-r--r--NEWS2
-rw-r--r--ext/session/session.c1
-rw-r--r--ext/session/tests/bug53141.phpt26
3 files changed, 29 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index f44206308b..6da02e2247 100644
--- a/NEWS
+++ b/NEWS
@@ -54,6 +54,8 @@
type is application/x-www-form-urlencoded or is not registered with PHP).
(gm at tlink dot de, Gustavo)
- Fixed bug #53144 (Segfault in SplObjectStorage::removeAll()). (Felipe)
+- Fixed bug #53141 (autoload misbehaves if called from closing session).
+ (ladislav at marek dot su)
- Fixed bug #53071 (SPLObjectStorage defeats gc_collect_cycles). (Gustavo)
- Fixed bug #53006 (stream_get_contents has an unpredictable behavior when the
underlying stream does not support seeking). (Gustavo)
diff --git a/ext/session/session.c b/ext/session/session.c
index 52bd17753e..dba1e2c9f8 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2282,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/bug53141.phpt b/ext/session/tests/bug53141.phpt
new file mode 100644
index 0000000000..765d2727e4
--- /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