Skip to content

Commit

Permalink
"MDL-14820, escape filename, merged from mOODLE_119_STABLE"
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsheng committed May 14, 2008
1 parent 64e6c53 commit 320061d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,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))) {
Expand All @@ -679,7 +679,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 />';
}
}
}
Expand Down

0 comments on commit 320061d

Please sign in to comment.