From 1a4eaaaf04808c48ab980622d0bd3492f562daf3 Mon Sep 17 00:00:00 2001 From: Simon Elvery Date: Thu, 6 Dec 2012 09:42:24 +1000 Subject: [PATCH] BUGFIX Ensure has length before using string index access. --- dev/LogErrorFileFormatter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/LogErrorFileFormatter.php b/dev/LogErrorFileFormatter.php index 30d1ad256..9b4f82f9b 100644 --- a/dev/LogErrorFileFormatter.php +++ b/dev/LogErrorFileFormatter.php @@ -30,7 +30,7 @@ class SS_LogErrorFileFormatter implements Zend_Log_Formatter_Interface { $urlSuffix = ''; $relfile = Director::makeRelative($errfile); - if($relfile[0] == '/') $relfile = substr($relfile, 1); + if(strlen($relfile) && $relfile[0] == '/') $relfile = substr($relfile, 1); if(isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] && isset($_SERVER['REQUEST_URI'])) { $urlSuffix = " (http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI])"; }