diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-17 15:47:18 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-17 15:47:18 +0000 |
commit | 7b1a8511ce1ae8e240720afe253618fb0866cac2 (patch) | |
tree | 9f758a7ee7982c69094e89dd1f1b757390f0706c /phpBB/includes/functions.php | |
parent | d095649a655ce7dfeae124b2946dadc5248eafc4 (diff) | |
download | forums-7b1a8511ce1ae8e240720afe253618fb0866cac2.tar forums-7b1a8511ce1ae8e240720afe253618fb0866cac2.tar.gz forums-7b1a8511ce1ae8e240720afe253618fb0866cac2.tar.bz2 forums-7b1a8511ce1ae8e240720afe253618fb0866cac2.tar.xz forums-7b1a8511ce1ae8e240720afe253618fb0866cac2.zip |
fixing one severe bug showing since 5.2.4
git-svn-id: file:///svn/phpbb/trunk@8201 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index f55a5b4d39..80a6faceca 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -683,6 +683,12 @@ if (!function_exists('realpath')) // Put the slashes back to the native operating systems slashes $resolved = str_replace('/', DIRECTORY_SEPARATOR, $resolved); + // Check for DIRECTORY_SEPARATOR at the end (and remove it!) + if (substr($resolved, -1) == DIRECTORY_SEPARATOR) + { + return substr($resolved, 0, -1); + } + return $resolved; // We got here, in the end! } } @@ -694,7 +700,15 @@ else */ function phpbb_realpath($path) { - return realpath($path); + $path = realpath($path); + + // Check for DIRECTORY_SEPARATOR at the end (and remove it!) + if (substr($path, -1) == DIRECTORY_SEPARATOR) + { + return substr($path, 0, -1); + } + + return $path; } } |