mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
- Fix bug #37510 session_regenerate_id changes session_id() even on failure
This commit is contained in:
parent
fbb48b6f26
commit
a4471f70f0
1 changed files with 6 additions and 1 deletions
|
@ -1364,6 +1364,11 @@ PHP_FUNCTION(session_regenerate_id)
|
|||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
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)) {
|
||||
if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
|
||||
|
@ -1720,6 +1725,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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue