From: Tim Düsterhus Date: Wed, 1 Jun 2016 14:55:04 +0000 (+0200) Subject: Fix erroneous shortening of parameters in stack trace X-Git-Tag: 3.0.0_Beta_1~1549 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=390ec50570caedd9f82a8e21022440b95da23780;p=GitHub%2FWoltLab%2FWCF.git Fix erroneous shortening of parameters in stack trace --- diff --git a/wcfsetup/install/files/lib/core.functions.php b/wcfsetup/install/files/lib/core.functions.php index d4f65bce63..d2a94e231d 100644 --- a/wcfsetup/install/files/lib/core.functions.php +++ b/wcfsetup/install/files/lib/core.functions.php @@ -508,30 +508,30 @@ EXPLANATION; }, $item['args']); } } - + if (!$ignorePaths) { $item['args'] = array_map(function ($item) { if (!is_string($item)) return $item; - - if (preg_match('~^'.preg_quote($_SERVER['DOCUMENT_ROOT'], '~').'~', $item)) { + + if (preg_match('~^('.preg_quote($_SERVER['DOCUMENT_ROOT'], '~').'|'.preg_quote(WCF_DIR, '~').')~', $item)) { $item = sanitizePath($item); } - return preg_replace('~^'.preg_quote(WCF_DIR, '~').'~', '*/', $item); + return $item; }, $item['args']); - + $item['file'] = sanitizePath($item['file']); } - + return $item; }, $trace); } - + function sanitizePath($path) { if (WCF::debugModeIsEnabled() && defined('EXCEPTION_PRIVACY') && EXCEPTION_PRIVACY === 'public') { return $path; } - + return '*/'.FileUtil::removeTrailingSlash(FileUtil::getRelativePath(WCF_DIR, $path)); } }