[feature/extension-manager] Correct default path comment & remove double strlen

PHPBB3-10323
This commit is contained in:
Nils Adermann 2011-11-18 13:10:09 +01:00
parent 64bf03f4ca
commit 7ee9a07179

View file

@ -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);
}