]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14279: Fixes for regressions created by the get_file_url massive change (merge...
authorscyrma <scyrma>
Fri, 11 Jul 2008 02:31:19 +0000 (02:31 +0000)
committerscyrma <scyrma>
Fri, 11 Jul 2008 02:31:19 +0000 (02:31 +0000)
files/index.php
lib/editor/htmlarea/coursefiles.php
lib/filelib.php

index 69e148b9f0c538bf6da7e0cd35c0fdd5e913fece..e869873d864397529ab0a7397131c181bfb06f74 100644 (file)
@@ -813,7 +813,7 @@ function displaydir ($wdir) {
             print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />", 'checkbox');
             echo "<td align=\"left\" style=\"white-space:nowrap\" class=\"name\">";
 
-            $ffurl = str_replace('//', '/', get_file_url("$id/$fileurl"));
+            $ffurl = get_file_url($id.'/'.$fileurl);
             link_to_popup_window ($ffurl, "display",
                                   "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />&nbsp;".htmlspecialchars($file),
                                   480, 640);
index 2a8496eaa16d9aaf55fc0fe8c8bbcbdb0d244567..f1ea8f28f43092acf768bacf4cddca0f4f7273bc 100644 (file)
@@ -755,7 +755,7 @@ function displaydir ($wdir) {
                 print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" onclick=\";return set_rename('$file');\" />");
             }
             echo "<td align=\"left\" nowrap=\"nowrap\">";
-            $ffurl = get_file_url($id$fileurl);
+            $ffurl = get_file_url($id.$fileurl);
             link_to_popup_window ($ffurl, "display",
                                   "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />",
                                   480, 640);
index 1adf6803bdff50c330b23b74781691aaa9830395..449cbc2a2d608a12701a12925725712f8a3eb53e 100644 (file)
@@ -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