aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Sroka <srokap@gmail.com>2013-03-06 19:04:35 +0100
committerPaweł Sroka <srokap@gmail.com>2013-03-11 03:42:26 +0100
commit2c7fe16e6d8d135109c6da60739e4ffad99876d5 (patch)
tree8ff2bda0b5ab7d2f333666abe3c7bdb719213cd0
parente9f710c18089489c402cae23fbac71c0b7283824 (diff)
downloadelgg-2c7fe16e6d8d135109c6da60739e4ffad99876d5.tar.gz
elgg-2c7fe16e6d8d135109c6da60739e4ffad99876d5.tar.bz2
Refs #5199 - Adds additional info to locate output start in case of headers already sent exception
-rw-r--r--engine/lib/elgglib.php4
-rw-r--r--languages/en.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 74b70f9fb..2ae307392 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -128,7 +128,7 @@ function elgg_load_library($name) {
* @throws SecurityException
*/
function forward($location = "", $reason = 'system') {
- if (!headers_sent()) {
+ if (!headers_sent($file, $line)) {
if ($location === REFERER) {
$location = $_SERVER['HTTP_REFERER'];
}
@@ -147,7 +147,7 @@ function forward($location = "", $reason = 'system') {
exit;
}
} else {
- throw new SecurityException(elgg_echo('SecurityException:ForwardFailedToRedirect'));
+ throw new SecurityException(elgg_echo('SecurityException:ForwardFailedToRedirect', array($file, $line)));
}
}
diff --git a/languages/en.php b/languages/en.php
index fe450b8a2..501855f02 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -175,7 +175,7 @@ $english = array(
'ConfigurationException:NoSiteID' => "No site ID has been specified.",
'SecurityException:APIAccessDenied' => "Sorry, API access has been disabled by the administrator.",
'SecurityException:NoAuthMethods' => "No authentication methods were found that could authenticate this API request.",
- 'SecurityException:ForwardFailedToRedirect' => 'Redirect could not be issued due to headers already being sent. Halting execution for security. Search http://docs.elgg.org/ for more information.',
+ 'SecurityException:ForwardFailedToRedirect' => 'Redirect could not be issued due to headers already being sent. Halting execution for security. Output started in file %s at line %d. Search http://docs.elgg.org/ for more information.',
'InvalidParameterException:APIMethodOrFunctionNotSet' => "Method or function not set in call in expose_method()",
'InvalidParameterException:APIParametersArrayStructure' => "Parameters array structure is incorrect for call to expose method '%s'",
'InvalidParameterException:UnrecognisedHttpMethod' => "Unrecognised http method %s for api method '%s'",