aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/extension/finder.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-11-18 13:10:09 +0100
committerNils Adermann <naderman@naderman.de>2011-11-18 13:10:09 +0100
commit7ee9a07179d880c788b6ccb0a136c9a957fd918c (patch)
tree1bdd4594a4bcfe5d8e73a9ed09d390167b68a7d8 /phpBB/includes/extension/finder.php
parent64bf03f4ca363f0f4b237a4cb32cde4f48cd158e (diff)
downloadforums-7ee9a07179d880c788b6ccb0a136c9a957fd918c.tar
forums-7ee9a07179d880c788b6ccb0a136c9a957fd918c.tar.gz
forums-7ee9a07179d880c788b6ccb0a136c9a957fd918c.tar.bz2
forums-7ee9a07179d880c788b6ccb0a136c9a957fd918c.tar.xz
forums-7ee9a07179d880c788b6ccb0a136c9a957fd918c.zip
[feature/extension-manager] Correct default path comment & remove double strlen
PHPBB3-10323
Diffstat (limited to 'phpBB/includes/extension/finder.php')
-rw-r--r--phpBB/includes/extension/finder.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php
index 6084d2672a..d84d27b9c4 100644
--- a/phpBB/includes/extension/finder.php
+++ b/phpBB/includes/extension/finder.php
@@ -77,7 +77,7 @@ class phpbb_extension_finder
/**
* Sets a default path to be searched in addition to extensions
*
- * @param string $default_path The path relative to /
+ * @param string $default_path The path relative to phpbb_root_path
* @return phpbb_extension_finder This object for chaining calls
*/
public function default_path($default_path)
@@ -162,8 +162,9 @@ class phpbb_extension_finder
public function directory($directory)
{
$directory = preg_replace('#(?:^|/)\./#', '/', $directory);
+ $dir_len = strlen($directory);
- if (strlen($directory) > 1 && $directory[strlen($directory) - 1] === '/')
+ if ($dir_len > 1 && $directory[$dir_len - 1] === '/')
{
$directory = substr($directory, 0, -1);
}