Merge pull request #1063 from drzax/log-file-formatter-fix

BUGFIX Ensure  has length before using string index access.
This commit is contained in:
Ingo Schommer 2012-12-20 10:19:03 -08:00
commit 6bcffd66ad

View File

@ -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])";
}