1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 04:30:29 +01:00

[ticket/10663] Extension finder should not find subdirs with directory filter

The directory filter pattern now has a $ in the end, do avoid subdirectories
from being matched as well.

PHPBB3-10663
This commit is contained in:
Nils Adermann 2012-02-21 18:32:08 +01:00
parent 3762bf5e99
commit 41870c4095

View File

@ -375,6 +375,10 @@ class phpbb_extension_finder
{
$directory_pattern = preg_quote(DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#');
}
if ($is_dir)
{
$directory_pattern .= '$';
}
$directory_pattern = '#' . $directory_pattern . '#';
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);