mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 17:44:48 +02:00
feat: sanitize root folder also in php error messages (#3262)
This commit is contained in:
parent
a01c1f6ab0
commit
007f2b2d8a
5 changed files with 38 additions and 17 deletions
|
@ -34,8 +34,12 @@ final class RssBridge
|
|||
if ((error_reporting() & $code) === 0) {
|
||||
return false;
|
||||
}
|
||||
$text = sprintf('%s at %s line %s', $message, trim_path_prefix($file), $line);
|
||||
// Drop the current frame
|
||||
$text = sprintf(
|
||||
'%s at %s line %s',
|
||||
sanitize_root($message),
|
||||
sanitize_root($file),
|
||||
$line
|
||||
);
|
||||
Logger::warning($text);
|
||||
if (Debug::isEnabled()) {
|
||||
print sprintf("<pre>%s</pre>\n", e($text));
|
||||
|
@ -49,8 +53,8 @@ final class RssBridge
|
|||
$message = sprintf(
|
||||
'Fatal Error %s: %s in %s line %s',
|
||||
$error['type'],
|
||||
$error['message'],
|
||||
trim_path_prefix($error['file']),
|
||||
sanitize_root($error['message']),
|
||||
sanitize_root($error['file']),
|
||||
$error['line']
|
||||
);
|
||||
Logger::error($message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue