From 2b5baa6e9a01ef8b7cb32a731cc74efb31eeabcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Oct 2006 14:06:56 +0000 Subject: [PATCH] Check for sent headers, provide backtrace in this case. --- ChangeLog | 2 ++ libraries/common.lib.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2350379d1..5410de07e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ $Source$ * libraries/import.lib.php: Correctly fail if file is too short (bug #1574340). * libraries/db_table_exists.lib.php: Fix displaying of entered query. + * libraries/common.lib.php: Check for sent headers, provide backtrace in + this case. 2006-10-09 Michal Čihař * lang/german: Fix typo (translation #1570611). diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 470f68d1f..89a3305e9 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -928,6 +928,14 @@ if (!defined('PMA_MINIMUM_COMMON')) { } } else { session_write_close(); + if (headers_sent()) { + if (function_exists(debug_print_backtrace)) { + echo '
';
+                        debug_print_backtrace();
+                        echo '
'; + } + trigger_error('PMA_sendHeaderLocation called when headers are already sent!', E_USER_ERROR); + } // bug #1523784: IE6 does not like 'Refresh: 0', it // results in a blank page // but we need it when coming from the cookie login panel)