Permalink
Browse files

MDL-14279: Fixes for regressions created by the get_file_url massive …

…change
  • Loading branch information...
1 parent 4035e4d commit 4c870678218d6460f92f8c8f7046390c4f61de1d scyrma committed Jul 11, 2008
Showing with 3 additions and 2 deletions.
  1. +1 −1 files/index.php
  2. +1 −1 lib/editor/htmlarea/coursefiles.php
  3. +1 −0 lib/filelib.php
View
@@ -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);
@@ -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);
View
@@ -5,6 +5,7 @@
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

0 comments on commit 4c87067

Please sign in to comment.