af9dc8
Backported from 5.4.20
af9dc8
af9dc8
From 336a8e1943af85bb49cb5986d897d967ba73dcc0 Mon Sep 17 00:00:00 2001
af9dc8
From: Dmitry Stogov <dmitry@zend.com>
af9dc8
Date: Mon, 10 Jun 2013 12:32:53 +0400
af9dc8
Subject: [PATCH] Callback has to be restored in MSHUTDOWN
af9dc8
af9dc8
---
af9dc8
 ext/session/session.c | 3 +++
af9dc8
 1 file changed, 3 insertions(+)
af9dc8
af9dc8
diff --git a/ext/session/session.c b/ext/session/session.c
af9dc8
index a3be9a7..d9989ba 100644
af9dc8
--- a/ext/session/session.c
af9dc8
+++ b/ext/session/session.c
af9dc8
@@ -2221,6 +2221,9 @@ static PHP_MSHUTDOWN_FUNCTION(session) /* {{{ */
af9dc8
 	PHP_MSHUTDOWN(ps_mm) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
af9dc8
 #endif
af9dc8
 
af9dc8
+	/* restore the orig callback */
af9dc8
+	php_rfc1867_callback = php_session_rfc1867_orig_callback;
af9dc8
+
af9dc8
 	ps_serializers[PREDEFINED_SERIALIZERS].name = NULL;
af9dc8
 	memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *));
af9dc8
 
af9dc8
From ba3234888dfbe14dadac7ac6c403a58bc1fdd220 Mon Sep 17 00:00:00 2001
af9dc8
From: Arpad Ray <arraypad@gmail.com>
af9dc8
Date: Wed, 17 Jul 2013 11:02:48 +0100
af9dc8
Subject: [PATCH] Fix bug #62129 - rfc1867 crashes php even though turned off
af9dc8
af9dc8
Patch by gxd305 at gmail dot com
af9dc8
---
af9dc8
 NEWS                  | 2 ++
af9dc8
 ext/session/session.c | 7 +++++--
af9dc8
 2 files changed, 7 insertions(+), 2 deletions(-)
af9dc8
af9dc8
diff --git a/ext/session/session.c b/ext/session/session.c
af9dc8
index 5af3ef2..bbfe90e 100644
af9dc8
--- a/ext/session/session.c
af9dc8
+++ b/ext/session/session.c
af9dc8
@@ -2221,8 +2221,11 @@ static PHP_MSHUTDOWN_FUNCTION(session) /* {{{ */
af9dc8
 	PHP_MSHUTDOWN(ps_mm) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
af9dc8
 #endif
af9dc8
 
af9dc8
-	/* restore the orig callback */
af9dc8
-	php_rfc1867_callback = php_session_rfc1867_orig_callback;
af9dc8
+	/* reset rfc1867 callbacks */
af9dc8
+	php_session_rfc1867_orig_callback = NULL;
af9dc8
+	if (php_rfc1867_callback == php_session_rfc1867_callback) {
af9dc8
+		php_rfc1867_callback = NULL;
af9dc8
+	}
af9dc8
 
af9dc8
 	ps_serializers[PREDEFINED_SERIALIZERS].name = NULL;
af9dc8
 	memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *));