MDL-14279: Fixes for regressions created by the get_file_url massive change (merge from 1.9)

This commit is contained in:
scyrma 2008-07-11 02:31:19 +00:00
parent ddeaf74d96
commit b0374a1692
3 changed files with 3 additions and 2 deletions

View 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);

View 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);

View 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