Only do str_replace if $file is actually a string.

This commit is contained in:
Bob den Otter
2013-04-06 16:01:09 +02:00
parent fc486e3f7a
commit aca7aa57bc
+1 -1
View File
@@ -39,7 +39,7 @@ class Frame
public function getFile($shortened = false)
{
$file = !empty($this->frame['file']) ? $this->frame['file'] : null;
if ($shortened) {
if ($shortened && is_string($file)) {
// Replace the part of the path that all frames have in common, and add 'soft hyphens' for smoother line-breaks.
$dirname = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__))))));
$file = str_replace($dirname, "", $file);