From 19f7484144e9054417ebb626da87b8af82ebc627 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 24 Nov 2010 06:23:51 +0000 Subject: [PATCH] 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 --- dev/LogErrorEmailFormatter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/LogErrorEmailFormatter.php b/dev/LogErrorEmailFormatter.php index db1ae3f15..df639e9f8 100644 --- a/dev/LogErrorEmailFormatter.php +++ b/dev/LogErrorEmailFormatter.php @@ -48,8 +48,11 @@ class SS_LogErrorEmailFormatter implements Zend_Log_Formatter_Interface { $relfile = Director::makeRelative($errfile); if($relfile[0] == '/') $relfile = substr($relfile, 1); + + $host = @$_SERVER['HTTP_HOST']; + $uri = @$_SERVER['REQUEST_URI']; - $subject = "$errorType at $relfile line {$errline} (http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI])"; + $subject = "$errorType at $relfile line {$errline} (http://{$host}{$uri})"; return array( 'subject' => $subject,