aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/extension/finder.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-09-17 16:15:44 +0200
committerNils Adermann <naderman@naderman.de>2013-09-17 16:15:44 +0200
commitc4b53490ad93566914cbc280910c67b75346a665 (patch)
tree206652fbbe1a3d0f3871a5342eef0b519773a079 /phpBB/phpbb/extension/finder.php
parentd12f35885539c8bd7d2d795d9fc5638d022698bb (diff)
downloadforums-c4b53490ad93566914cbc280910c67b75346a665.tar
forums-c4b53490ad93566914cbc280910c67b75346a665.tar.gz
forums-c4b53490ad93566914cbc280910c67b75346a665.tar.bz2
forums-c4b53490ad93566914cbc280910c67b75346a665.tar.xz
forums-c4b53490ad93566914cbc280910c67b75346a665.zip
[ticket/11700] Correctly load extensions with nonprefixed namespaces
PHPBB3-11700
Diffstat (limited to 'phpBB/phpbb/extension/finder.php')
-rw-r--r--phpBB/phpbb/extension/finder.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/phpbb/extension/finder.php b/phpBB/phpbb/extension/finder.php
index 338f1cdeb9..d3e73bc387 100644
--- a/phpBB/phpbb/extension/finder.php
+++ b/phpBB/phpbb/extension/finder.php
@@ -277,15 +277,16 @@ class finder
$classes = array();
foreach ($files as $file => $ext_name)
{
- if (preg_match('#^includes/#', $file))
+ $class = substr($file, 0, -strlen('.' . $this->php_ext));
+ if ($ext_name === '/' && preg_match('#^includes/#', $file))
{
- $file = preg_replace('#^includes/#', '', $file);
- $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen('.' . $this->php_ext)));
+ $class = preg_replace('#^includes/#', '', $class);
+ $classes[] = 'phpbb_' . str_replace('/', '_', $class);
}
else
- {
- $file = preg_replace('#^phpbb/#', '', $file);
- $classes[] = 'phpbb\\' . str_replace('/', '\\', substr($file, 0, -strlen('.' . $this->php_ext)));
+ {
+ $class = preg_replace('#^ext/#', '', $class);
+ $classes[] = str_replace('/', '\\', $class);
}
}
return $classes;