diff --git a/files/index.php b/files/index.php index 64da2bf0954..889ce72e6dd 100644 --- a/files/index.php +++ b/files/index.php @@ -184,7 +184,7 @@ case "move": html_header($course, $wdir); - if ($count = setfilelist($_POST)) { + if (($count = setfilelist($_POST)) and confirm_sesskey()) { $USER->fileop = $action; $USER->filesource = $wdir; echo "
"; @@ -197,7 +197,7 @@ case "paste": html_header($course, $wdir); - if (isset($USER->fileop) and $USER->fileop == "move") { + if (isset($USER->fileop) and ($USER->fileop == "move") and confirm_sesskey()) { foreach ($USER->filelist as $file) { $shortfile = basename($file); $oldfile = $basedir.$file; @@ -291,7 +291,7 @@ case "edit": html_header($course, $wdir); - if (isset($text)) { + if (isset($text) and confirm_sesskey()) { $fileptr = fopen($basedir.$file,"w"); fputs($fileptr, stripslashes($text)); fclose($fileptr); @@ -318,6 +318,7 @@ echo " "; echo " "; echo " "; + echo " sesskey\" />"; print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); echo "