]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #5199 - Adds additional info to locate output start in case of headers already...
authorPaweł Sroka <srokap@gmail.com>
Wed, 6 Mar 2013 18:04:35 +0000 (19:04 +0100)
committerPaweł Sroka <srokap@gmail.com>
Mon, 11 Mar 2013 02:42:26 +0000 (03:42 +0100)
engine/lib/elgglib.php
languages/en.php

index 74b70f9fb7cf76e7bf4709cbf447ddb6db82bad2..2ae3073921f24c6317b00d1bcb3ee34337540363 100644 (file)
@@ -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)));
        }
 }
 
index fe450b8a207549893a5b101ddbedecaaa3c426b9..501855f02be5e68639ab4348c32217d5b26fb78b 100644 (file)
@@ -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'",