]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0'
authorAnatol Belski <ab@php.net>
Fri, 29 Jan 2016 14:19:40 +0000 (15:19 +0100)
committerAnatol Belski <ab@php.net>
Fri, 29 Jan 2016 14:19:40 +0000 (15:19 +0100)
* PHP-7.0:
  fix wrong gc sequence

1  2 
ext/session/session.c

index b7a1611363dae8486e0ef7ac134c508d77d84579,d67045ed8977b436614f31139f5a097c2b02473a..5f44f991c170660792fb8b196a4adc139585c3a4
@@@ -556,19 -541,21 +556,20 @@@ 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();
        /* 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_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
 -              */
 +              php_error_docref(NULL, E_WARNING, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
 +              return;
        }
+       /* GC must be done after read */
+       php_session_gc();
        if (PS(session_vars)) {
                zend_string_release(PS(session_vars));
                PS(session_vars) = NULL;