aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/extension/finder.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/phpBB/phpbb/extension/finder.php b/phpBB/phpbb/extension/finder.php
index 6cc6e1808a..09c4f6d3e0 100644
--- a/phpBB/phpbb/extension/finder.php
+++ b/phpBB/phpbb/extension/finder.php
@@ -463,6 +463,7 @@ class finder
}
else if ($directory && $directory[0] === '/')
{
+ $path .= substr($directory, 1);
$directory_pattern = '^' . preg_quote(str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#');
}
else
@@ -494,7 +495,11 @@ class finder
if ($is_dir)
{
$relative_path = $iterator->getInnerIterator()->getSubPath() . DIRECTORY_SEPARATOR . basename($filename) . DIRECTORY_SEPARATOR;
- if ($relative_path[0] !== DIRECTORY_SEPARATOR)
+ if ($directory && $directory[0] === '/')
+ {
+ $relative_path = str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR . $relative_path;
+ }
+ else if ($relative_path[0] !== DIRECTORY_SEPARATOR)
{
$relative_path = DIRECTORY_SEPARATOR . $relative_path;
}
@@ -502,6 +507,14 @@ class finder
else
{
$relative_path = DIRECTORY_SEPARATOR . $iterator->getInnerIterator()->getSubPathname();
+ if ($directory && $directory[0] === '/')
+ {
+ $relative_path = str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR . $relative_path;
+ }
+ else
+ {
+ $relative_path = DIRECTORY_SEPARATOR . $relative_path;
+ }
}
if ((!$suffix || substr($relative_path, -strlen($suffix)) === $suffix) &&