From fa95ccea239b46287a7867d38d39e4e0c51fad6c Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 17 Feb 2023 11:31:34 +0000 Subject: [PATCH] Don't crash if /dev/tty is missing --- ext/log_console/main.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/log_console/main.php b/ext/log_console/main.php index 46bd99b8..a3ccbc54 100644 --- a/ext/log_console/main.php +++ b/ext/log_console/main.php @@ -82,8 +82,10 @@ class LogConsole extends Extension } if (!defined("UNITTEST") && PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { $fp = fopen("/dev/tty", "w"); - fwrite($fp, $str); - fclose($fp); + if($fp) { + fwrite($fp, $str); + fclose($fp); + } } } }