Fix erroneous shortening of parameters in stack trace
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 1 Jun 2016 14:55:04 +0000 (16:55 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 1 Jun 2016 14:55:04 +0000 (16:55 +0200)
wcfsetup/install/files/lib/core.functions.php

index d4f65bce6393c79da1d19f2e7d90c1206ca05c37..d2a94e231d7242133c5e7b1b72c606bc5bc8df82 100644 (file)
@@ -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));
        }
 }