do not show full path of file on php-error; fixes #1720

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2017-02-12 16:33:00 +01:00
parent d1c776b706
commit a4f72cbb40

View File

@@ -25,6 +25,8 @@ function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext) {
if (empty($theme)) { if (empty($theme)) {
$theme = "Sparkle"; $theme = "Sparkle";
} }
// prevent possible file-path-disclosure
$errfile = str_replace(FROXLOR_INSTALL_DIR, "", $errfile);
// if we're not on the shell, output a nicer error-message // if we're not on the shell, output a nicer error-message
$err_hint = file_get_contents(FROXLOR_INSTALL_DIR.'/templates/'.$theme.'/misc/phperrornice.tpl'); $err_hint = file_get_contents(FROXLOR_INSTALL_DIR.'/templates/'.$theme.'/misc/phperrornice.tpl');
// replace values // replace values