mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 15:57:45 +02:00
[ticket/15253] Replace realpath with helper
PHPBB3-15253
This commit is contained in:
@@ -468,27 +468,7 @@ class filesystem implements filesystem_interface
|
|||||||
*/
|
*/
|
||||||
public function realpath($path)
|
public function realpath($path)
|
||||||
{
|
{
|
||||||
if (!function_exists('realpath'))
|
return helper::realpath($path);
|
||||||
{
|
|
||||||
return $this->phpbb_own_realpath($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
$realpath = realpath($path);
|
|
||||||
|
|
||||||
// Strangely there are provider not disabling realpath but returning strange values. :o
|
|
||||||
// We at least try to cope with them.
|
|
||||||
if ((!$this->is_absolute_path($path) && $realpath === $path) || $realpath === false)
|
|
||||||
{
|
|
||||||
return $this->phpbb_own_realpath($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for DIRECTORY_SEPARATOR at the end (and remove it!)
|
|
||||||
if (substr($realpath, -1) === DIRECTORY_SEPARATOR)
|
|
||||||
{
|
|
||||||
$realpath = substr($realpath, 0, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $realpath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user