"MDL-14820, escape filename"

This commit is contained in:
dongsheng
2008-05-14 05:21:01 +00:00
parent 48f758e26d
commit 18aa02efdd
+2 -2
View File
@@ -654,7 +654,7 @@ function printfilelist($filelist) {
foreach ($filelist as $file) {
if (is_dir($basedir.'/'.$file)) {
echo "<img src=\"$CFG->pixpath/f/folder.gif\" class=\"icon\" alt=\"$strfolder\" /> $file<br />";
echo '<img src="'. $CFG->pixpath .'/f/folder.gif" class="icon" alt="'. $strfolder .'" /> '. htmlspecialchars($file) .'<br />';
$subfilelist = array();
$currdir = opendir($basedir.'/'.$file);
while (false !== ($subfile = readdir($currdir))) {
@@ -666,7 +666,7 @@ function printfilelist($filelist) {
} else {
$icon = mimeinfo("icon", $file);
echo "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> $file<br />";
echo '<img src="'. $CFG->pixpath .'/f/'. $icon .'" class="icon" alt="'. $strfile .'" /> '. htmlspecialchars($file) .'<br />';
}
}
}