From 7b1a8511ce1ae8e240720afe253618fb0866cac2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 17 Oct 2007 15:47:18 +0000 Subject: fixing one severe bug showing since 5.2.4 git-svn-id: file:///svn/phpbb/trunk@8201 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions.php') 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; } } -- cgit v1.2.1