diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-23 17:10:29 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-23 17:10:29 +0000 |
commit | 4baefc18f0d799d02d220360d2ccbb50d135c2d3 (patch) | |
tree | f02da5cfd6c855fc0590aabf39012447c0b00712 /engine/lib | |
parent | 5601a409996748435978fd45548d7daaab7b1454 (diff) | |
download | elgg-4baefc18f0d799d02d220360d2ccbb50d135c2d3.tar.gz elgg-4baefc18f0d799d02d220360d2ccbb50d135c2d3.tar.bz2 |
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
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 3 |
1 files changed, 2 insertions, 1 deletions
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); |