From 41870c40954bdd0faad2ce4b01fb416a03eed4e0 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 21 Feb 2012 18:32:08 +0100 Subject: [PATCH] [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 --- phpBB/includes/extension/finder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index e5e5e4983e..23b9f1c658 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -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);