BUGFIX Don't rely on existence of REQUEST_URI in LogErrorEmailFormatter (not set on CLI calls)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114138 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-11-24 06:23:51 +00:00
parent 07c821c4a7
commit 19f7484144

View File

@ -49,7 +49,10 @@ class SS_LogErrorEmailFormatter implements Zend_Log_Formatter_Interface {
$relfile = Director::makeRelative($errfile);
if($relfile[0] == '/') $relfile = substr($relfile, 1);
$subject = "$errorType at $relfile line {$errline} (http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI])";
$host = @$_SERVER['HTTP_HOST'];
$uri = @$_SERVER['REQUEST_URI'];
$subject = "$errorType at $relfile line {$errline} (http://{$host}{$uri})";
return array(
'subject' => $subject,