You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unify headers already sent/session already started error handler (#16451)
* Unify headers already sent errors
Now whenever we need to check where headers were already sent in
ext/session, we call a single location that prints where, keeping it
consistent output wise.
* Unify session aready started errors
Similar to the one for headers.
* Also change session active checks too
This usually go hand in hand with the headers already sent checks, but
is in a separate commit because of the amount of tests it changes.
php_error_docref(NULL, severity, "%s (started from %s on line %"PRIu32")", message, ZSTR_VAL(PS(session_started_filename)), PS(session_started_lineno));
138
+
} elseif (PS(auto_start)) {
139
+
/* This option can't be changed at runtime, so we can assume it's because of this */
140
+
php_error_docref(NULL, severity, "%s (session started automatically)", message);
php_error_docref(NULL, E_WARNING, "Session cache limiter cannot be sent after headers have already been sent (output started at %s:%d)", output_start_filename, output_start_lineno);
1336
-
} else {
1337
-
php_error_docref(NULL, E_WARNING, "Session cache limiter cannot be sent after headers have already been sent");
1338
-
}
1354
+
php_session_headers_already_sent_error(E_WARNING, "Session cache limiter cannot be sent after headers have already been sent");
php_error_docref(NULL, E_WARNING, "Session cookie cannot be sent after headers have already been sent (output started at %s:%d)", output_start_filename, output_start_lineno);
1412
-
} else {
1413
-
php_error_docref(NULL, E_WARNING, "Session cookie cannot be sent after headers have already been sent");
1414
-
}
1423
+
php_session_headers_already_sent_error(E_WARNING, "Session cookie cannot be sent after headers have already been sent");
php_error(E_NOTICE, "Ignoring session_start() because a session has already been started (started from %s on line %"PRIu32")", ZSTR_VAL(PS(session_started_filename)), PS(session_started_lineno));
1611
-
} elseif (PS(auto_start)) {
1612
-
/* This option can't be changed at runtime, so we can assume it's because of this */
1613
-
php_error(E_NOTICE, "Ignoring session_start() because a session has already been started automatically");
1614
-
} else {
1615
-
php_error(E_NOTICE, "Ignoring session_start() because a session has already been started");
1616
-
}
1618
+
php_session_session_already_started_error(E_NOTICE, "Ignoring session_start() because a session has already been started");
php_error_docref(NULL, E_NOTICE, "Ignoring session_start() because a session is already active (started from %s on line %"PRIu32")", ZSTR_VAL(PS(session_started_filename)), PS(session_started_lineno));
2642
-
} elseif (PS(auto_start)) {
2643
-
/* This option can't be changed at runtime, so we can assume it's because of this */
2644
-
php_error_docref(NULL, E_NOTICE, "Ignoring session_start() because a session is already automatically active");
2645
-
} else {
2646
-
php_error_docref(NULL, E_NOTICE, "Ignoring session_start() because a session is already active");
2647
-
}
2642
+
php_session_session_already_started_error(E_NOTICE, "Ignoring session_start() because a session is already active");
php_error_docref(NULL, E_WARNING, "Session cannot be started after headers have already been sent (sent from %s on line %d)", output_start_filename, output_start_lineno);
2662
-
} else {
2663
-
php_error_docref(NULL, E_WARNING, "Session cannot be started after headers have already been sent");
2664
-
}
2652
+
php_session_headers_already_sent_error(E_WARNING, "Session cannot be started after headers have already been sent");
0 commit comments