MDL-13792 - Fix to prevent urlencoding of '/'
This commit is contained in:
@@ -268,7 +268,7 @@ class assignment_upload extends assignment_base {
|
||||
foreach ($files as $key => $file) {
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
$icon = mimeinfo('icon', $file);
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=". urlencode("/$filearea/$file");
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=/". urlencode($filearea) .'/'. urlencode($file);
|
||||
$output .= '<a href="'.$ffurl.'" ><img class="icon" src="'.$CFG->pixpath.'/f/'.$icon.'" alt="'.$icon.'" />'.$file.'</a> ';
|
||||
}
|
||||
}
|
||||
@@ -327,7 +327,7 @@ class assignment_upload extends assignment_base {
|
||||
|
||||
$icon = mimeinfo('icon', $file);
|
||||
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=". urlencode("/$filearea/$file");
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=/". urlencode($filearea) .'/'. urlencode($file);
|
||||
|
||||
|
||||
$output .= '<a href="'.$ffurl.'" ><img src="'.$CFG->pixpath.'/f/'.$icon.'" class="icon" alt="'.$icon.'" />'.$file.'</a>';
|
||||
@@ -382,7 +382,7 @@ class assignment_upload extends assignment_base {
|
||||
|
||||
$icon = mimeinfo('icon', $file);
|
||||
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=". urlencode("/$filearea/$file");
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=/". urlencode($filearea) .'/'. urlencode($file);
|
||||
|
||||
$output .= '<a href="'.$ffurl.'" ><img class="align" src="'.$CFG->pixpath.'/f/'.$icon.'" alt="'.$icon.'" />'.$file.'</a>';
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ class assignment_uploadsingle extends assignment_base {
|
||||
$icon = mimeinfo('icon', $file);
|
||||
|
||||
if ($CFG->slasharguments) {
|
||||
$ffurl = "$CFG->wwwroot/file.php". urlencode("/$filearea/$file");
|
||||
$ffurl = "$CFG->wwwroot/file.php/". urlencode($filearea) .'/'. urlencode($file);
|
||||
} else {
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=". urlencode("/$filearea/$file");
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=/". urlencode($filearea) .'/'. urlencode($file);
|
||||
}
|
||||
//died right here
|
||||
//require_once($ffurl);
|
||||
|
||||
Reference in New Issue
Block a user