From: scyrma Date: Fri, 11 Jul 2008 02:31:19 +0000 (+0000) Subject: MDL-14279: Fixes for regressions created by the get_file_url massive change (merge... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b0374a1692c0005b10da50417503a96b777693e5;p=moodle.git MDL-14279: Fixes for regressions created by the get_file_url massive change (merge from 1.9) --- diff --git a/files/index.php b/files/index.php index 69e148b9f0..e869873d86 100644 --- a/files/index.php +++ b/files/index.php @@ -813,7 +813,7 @@ function displaydir ($wdir) { print_cell("center", "", 'checkbox'); echo ""; - $ffurl = str_replace('//', '/', get_file_url("$id/$fileurl")); + $ffurl = get_file_url($id.'/'.$fileurl); link_to_popup_window ($ffurl, "display", "pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> ".htmlspecialchars($file), 480, 640); diff --git a/lib/editor/htmlarea/coursefiles.php b/lib/editor/htmlarea/coursefiles.php index 2a8496eaa1..f1ea8f28f4 100644 --- a/lib/editor/htmlarea/coursefiles.php +++ b/lib/editor/htmlarea/coursefiles.php @@ -755,7 +755,7 @@ function displaydir ($wdir) { print_cell("center", ""); } echo ""; - $ffurl = get_file_url($id$fileurl); + $ffurl = get_file_url($id.$fileurl); link_to_popup_window ($ffurl, "display", "pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />", 480, 640); diff --git a/lib/filelib.php b/lib/filelib.php index 1adf6803bd..449cbc2a2d 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -5,6 +5,7 @@ define('BYTESERVING_BOUNDARY', 's1k2o3d4a5k6s7'); //unique string constant function get_file_url($path, $options=null, $type='coursefile') { global $CFG; + $path = str_replace('//', '/', $path); $path = trim($path, '/'); // no leading and trailing slashes // type of file