aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-02-18 11:24:27 -0500
committerDavid King <imkingdavid@gmail.com>2012-03-19 09:12:32 -0400
commite45452d1b3d39220ebd9b20390b9cc23ef64d3dd (patch)
tree35026e535272865a9e22e0ffeaf20fb57425bffb
parent969c6d42e390fe05960d9dd3b97b230d4e7830a0 (diff)
downloadforums-e45452d1b3d39220ebd9b20390b9cc23ef64d3dd.tar
forums-e45452d1b3d39220ebd9b20390b9cc23ef64d3dd.tar.gz
forums-e45452d1b3d39220ebd9b20390b9cc23ef64d3dd.tar.bz2
forums-e45452d1b3d39220ebd9b20390b9cc23ef64d3dd.tar.xz
forums-e45452d1b3d39220ebd9b20390b9cc23ef64d3dd.zip
[ticket/10586] Sanitize periods from class names, use manager to get path.
PHPBB3-10586
-rw-r--r--phpBB/includes/extension/manager.php2
-rw-r--r--phpBB/index.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php
index b94379141c..6f1c885ea9 100644
--- a/phpBB/includes/extension/manager.php
+++ b/phpBB/includes/extension/manager.php
@@ -437,7 +437,7 @@ class phpbb_extension_manager
*/
public function available($name)
{
- return file_exists($this->phpbb_root_path . "ext/$name/");
+ return file_exists($this->get_extension_path($name, true));
}
/**
diff --git a/phpBB/index.php b/phpBB/index.php
index 575134f6b1..e6a472ce31 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -28,7 +28,7 @@ $user->setup('viewforum');
if ($ext = $request->variable('ext', ''))
{
// The class to load
- $class = "phpbb_ext_{$ext}_controller";
+ $class = 'phpbb_ext_' . str_replace('/', '_', $name) . '_controller';
// Make sure the specified extension is enabled
// and that it has a controller class