Commit 9f28ec37 authored by Nigel McNie's avatar Nigel McNie
Browse files

Use correct exception type in redirect(), report what file/line output started on if it did.

This will make it easier to debug such problems in the future.
(cherry picked from commit 8c869919)
parent 744028cf
......@@ -1901,8 +1901,9 @@ function get_site_page_content($pagename) {
* the application home page.
*/
function redirect($location='/') {
if (headers_sent()) {
throw new Exception('Headers already sent when redirect() was called');
$file = $line = null;
if (headers_sent($file, $line)) {
throw new SystemException("Headers already sent when redirect() was called (output started in $file on line $line");
}
if (substr($location, 0, 4) != 'http') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment