From 3762bf5e99f0ac4202aec117a959b64efc98deff Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Tue, 21 Feb 2012 18:19:14 +0200 Subject: [PATCH 1/2] [ticket/10663] Adding nested directory to finder test Adding nested directory to finder test, triggering finder bug PHPBB3-10663 --- tests/extension/ext/foo/type/dummy/empty.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/extension/ext/foo/type/dummy/empty.txt diff --git a/tests/extension/ext/foo/type/dummy/empty.txt b/tests/extension/ext/foo/type/dummy/empty.txt new file mode 100644 index 0000000000..e69de29bb2 From 41870c40954bdd0faad2ce4b01fb416a03eed4e0 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 21 Feb 2012 18:32:08 +0100 Subject: [PATCH 2/2] [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);