From 475bb1a0337befaed1d3b06e7211a4d182cf38f3 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Wed, 1 Dec 2021 00:51:23 +0000 Subject: [PATCH] [UTIL][EXCEPTION][BugFoundException] Use only the relative path, for convenience and to avoid potentially leaking the sysadmin's user --- src/Util/Exception/BugFoundException.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Util/Exception/BugFoundException.php b/src/Util/Exception/BugFoundException.php index a00b09321d..5b4ef08b96 100644 --- a/src/Util/Exception/BugFoundException.php +++ b/src/Util/Exception/BugFoundException.php @@ -44,6 +44,7 @@ class BugFoundException extends ServerException { parent::__construct($message, $code, $previous); $frame = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, limit: 2)[1]; - Log::critical("{$log_message} in {$frame['file']}:{$frame['line']}"); + $file = mb_substr($frame['file'], \mb_strlen(INSTALLDIR) + 1); + Log::critical("{$log_message} in {$file}:{$frame['line']}"); } }