Permalink
Browse files

BUGFIX Ensure has length before using string index access.

  • Loading branch information...
1 parent 9b3aebd commit 1a4eaaaf04808c48ab980622d0bd3492f562daf3 @drzax drzax committed Dec 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 dev/LogErrorFileFormatter.php
@@ -30,7 +30,7 @@ public function format($event) {
$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])";
}

0 comments on commit 1a4eaaa

Please sign in to comment.