]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2741 skipping :// when replacing // in file paths so that we support URIs
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 23 Dec 2010 17:10:29 +0000 (17:10 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 23 Dec 2010 17:10:29 +0000 (17:10 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7709 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php

index 8bbdf8758588ae4b8b942828cfa3c4540879620c..2ca1f90e320f3503ccb188b2408ebdab7d2ada48 100644 (file)
@@ -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);