mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12589] Fix tests
PHPBB3-12589
This commit is contained in:
parent
f7896f46a5
commit
930c5d85ed
1 changed files with 44 additions and 42 deletions
|
@ -462,8 +462,11 @@ class finder
|
|||
$directory_pattern = '^' . preg_quote(DIRECTORY_SEPARATOR, '#');
|
||||
}
|
||||
else if ($directory && $directory[0] === '/')
|
||||
{
|
||||
if (!$is_dir)
|
||||
{
|
||||
$path .= substr($directory, 1);
|
||||
}
|
||||
$directory_pattern = '^' . preg_quote(str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#');
|
||||
}
|
||||
else
|
||||
|
@ -476,6 +479,8 @@ class finder
|
|||
}
|
||||
$directory_pattern = '#' . $directory_pattern . '#';
|
||||
|
||||
if (is_dir($path))
|
||||
{
|
||||
$iterator = new \RecursiveIteratorIterator(
|
||||
new \phpbb\recursive_dot_prefix_filter_iterator(
|
||||
new \RecursiveDirectoryIterator(
|
||||
|
@ -495,18 +500,14 @@ class finder
|
|||
if ($is_dir)
|
||||
{
|
||||
$relative_path = $iterator->getInnerIterator()->getSubPath() . DIRECTORY_SEPARATOR . basename($filename) . DIRECTORY_SEPARATOR;
|
||||
if ($directory && $directory[0] === '/')
|
||||
{
|
||||
$relative_path = str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR . $relative_path;
|
||||
}
|
||||
else if ($relative_path[0] !== DIRECTORY_SEPARATOR)
|
||||
if ($relative_path[0] !== DIRECTORY_SEPARATOR)
|
||||
{
|
||||
$relative_path = DIRECTORY_SEPARATOR . $relative_path;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$relative_path = DIRECTORY_SEPARATOR . $iterator->getInnerIterator()->getSubPathname();
|
||||
$relative_path = $iterator->getInnerIterator()->getSubPathname();
|
||||
if ($directory && $directory[0] === '/')
|
||||
{
|
||||
$relative_path = str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR . $relative_path;
|
||||
|
@ -531,6 +532,7 @@ class finder
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($cache && $this->cache)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue