mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 10:28:55 +00:00
[ticket/15253] Replace realpath with helper
PHPBB3-15253
This commit is contained in:
parent
45334eadb6
commit
9ff25b5970
1 changed files with 1 additions and 21 deletions
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue