mirror of
https://github.com/filp/whoops.git
synced 2026-09-11 02:06:20 +00:00
Only do str_replace if $file is actually a string.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user