[ticket/15253] Fix code

PHPBB3-15253
This commit is contained in:
Rubén Calvo 2017-06-28 13:33:19 +02:00
parent a01d33b1fa
commit 436410761d
2 changed files with 2 additions and 18 deletions

View file

@ -96,11 +96,6 @@ function phpbb_check_hash($password, $hash)
*/ */
function phpbb_clean_path($path) function phpbb_clean_path($path)
{ {
if (!class_exists('\phpbb\filesystem\helper'))
{
require($phpbb_root_path . 'phpbb/filesystem/helper.' . $phpEx);
}
return \phpbb\filesystem\helper::clean_path($path); return \phpbb\filesystem\helper::clean_path($path);
} }
@ -443,11 +438,6 @@ function phpbb_is_writable($file)
*/ */
function phpbb_is_absolute($path) function phpbb_is_absolute($path)
{ {
if (!class_exists('\phpbb\filesystem\helper'))
{
require($phpbb_root_path . 'phpbb/filesystem/helper.' . $phpEx);
}
return \phpbb\filesystem\helper::is_absolute_path($path); return \phpbb\filesystem\helper::is_absolute_path($path);
} }
@ -458,11 +448,6 @@ function phpbb_is_absolute($path)
*/ */
function phpbb_realpath($path) function phpbb_realpath($path)
{ {
if (!class_exists('\phpbb\filesystem\helper'))
{
require($phpbb_root_path . 'phpbb/filesystem/helper.' . $phpEx);
}
return \phpbb\filesystem\helper::realpath($path); return \phpbb\filesystem\helper::realpath($path);
} }

View file

@ -17,7 +17,6 @@ use Symfony\Component\Filesystem\Filesystem as symfony_filesystem;
class helper class helper
{ {
/** /**
* @var \Symfony\Component\Filesystem\Filesystem * @var \Symfony\Component\Filesystem\Filesystem
*/ */
@ -234,7 +233,7 @@ class helper
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path); $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
} }
trim ($path, '/'); trim($path, '/');
$path_parts = explode('/', $path); $path_parts = explode('/', $path);
$resolved = array(); $resolved = array();
$resolved_path = $prefix; $resolved_path = $prefix;
@ -366,7 +365,7 @@ class helper
} }
} }
return ($return_array) ? $resolved : $resolved_path; return $return_array ? $resolved : $resolved_path;
} }
/** /**