From 1df9ac10a0c9e84be93fd5df911776594cdfe52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9meth=20Bal=C3=A1zs?= Date: Mon, 29 Apr 2019 15:39:27 +0200 Subject: [PATCH] Fix file_get_contents to handle internal PHP extension errors correctly. --- src/Whoops/Exception/Frame.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Whoops/Exception/Frame.php b/src/Whoops/Exception/Frame.php index 0aad546..eb0b090 100644 --- a/src/Whoops/Exception/Frame.php +++ b/src/Whoops/Exception/Frame.php @@ -119,7 +119,11 @@ class Frame implements Serializable return null; } - $this->fileContentsCache = file_get_contents($filePath); + try { + $this->fileContentsCache = file_get_contents($filePath); + } catch (ErrorException $exception) { + return null; + } } return $this->fileContentsCache;