[UTIL][EXCEPTION][BugFoundException] Use only the relative path, for convenience and to avoid potentially leaking the sysadmin's user

This commit is contained in:
Hugo Sales 2021-12-01 00:51:23 +00:00 committed by Diogo Peralta Cordeiro
parent d4c77925d2
commit 475bb1a033
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 2 additions and 1 deletions

View File

@ -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']}");
}
}