From 7ee9a07179d880c788b6ccb0a136c9a957fd918c Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 18 Nov 2011 13:10:09 +0100 Subject: [PATCH] [feature/extension-manager] Correct default path comment & remove double strlen PHPBB3-10323 --- phpBB/includes/extension/finder.php | 5 +++-- 1 file 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); }