]> granicus.if.org Git - php/commitdiff
- MFH Fix bug #37510 session_regenerate_id changes session_id() even on failure
authorMarcus Boerger <helly@php.net>
Thu, 18 May 2006 22:16:27 +0000 (22:16 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 18 May 2006 22:16:27 +0000 (22:16 +0000)
NEWS
ext/session/session.c

diff --git a/NEWS b/NEWS
index d086eab1b5e415f6e8e2c67594ef445da022c08e..4557cf66b94f86b2a863286d418051d825092fe4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ PHP 4                                                                      NEWS
 - Updated PCRE to version 6.6. (Andrei)
 - Added overflow checks to wordwrap() function. (Ilia)
 - Added a check for special characters in the session name. (Ilia)
+- Fixed bug #37510 session_regenerate_id changes session_id() even on failure).
+  (Hannes)
 - Fixed bug #34360 (bad gif size) (Pierre)
 - Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia)
 - Fixed bug #37346 (invalid colormap format) (Pierre)
index f02884c175409b59863c8c4a2a8eaf317d08da0a..98980e9280dbaec99f8a42a57449892b29edf81b 100644 (file)
@@ -1351,6 +1351,10 @@ PHP_FUNCTION(session_id)
    Update the current session id with a newly generated one. */
 PHP_FUNCTION(session_regenerate_id)
 {
+       if (SG(headers_sent)) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot regenerate session id - headers already sent");
+               RETURN_FALSE;
+       }
        if (PS(session_status) == php_session_active) {
                if (PS(id)) efree(PS(id));
        
@@ -1780,6 +1784,6 @@ PHP_MINFO_FUNCTION(session)
  * tab-width: 4
  * c-basic-offset: 4
  * End:
- * vim600: sw=4 ts=4 fdm=marker
+ * vim600: noet sw=4 ts=4 fdm=marker
  * vim<600: sw=4 ts=4
  */