From 4baefc18f0d799d02d220360d2ccbb50d135c2d3 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 23 Dec 2010 17:10:29 +0000 Subject: Fixes #2741 skipping :// when replacing // in file paths so that we support URIs git-svn-id: http://code.elgg.org/elgg/trunk@7709 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 8bbdf8758..2ca1f90e3 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -447,7 +447,8 @@ function sanitise_filepath($path, $append_slash = TRUE) { // Convert to correct UNIX paths $path = str_replace('\\', '/', $path); $path = str_replace('../', '/', $path); - $path = str_replace('//', '/', $path); + // replace // with / except when preceeded by : + $path = preg_replace("/([^:])\/\//", "$1/", $path); // Sort trailing slash $path = trim($path); -- cgit v1.2.3