1
0
Fork 0

avoid double slash

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@174 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.2
Xuefer 2006-09-17 02:14:51 +00:00
parent 182e31fe5d
commit 9273087b98
1 changed files with 3 additions and 1 deletions

View File

@ -61,7 +61,9 @@ class XcacheCoverageViewer
$this->path = isset($_GET['path']) ? $_GET['path'] : '';
$this->path = preg_replace('!\.{2,}!', '.', $this->path);
$this->path = preg_replace('![\\\\/]{2,}!', '/', $this->path);
$qsep = preg_quote(DIRECTORY_SEPARATOR, '!');
$this->path = preg_replace("![\\\\$qsep]{2,}!", DIRECTORY_SEPARATOR, $this->path);
$this->path = preg_replace("!$qsep$!", '', $this->path);
if ($this->path == '/') {
$this->path = '';
}