fixed register globals issue with $text; merged from MOODLE_16_STABLE

This commit is contained in:
skodak
2006-05-21 08:09:43 +00:00
parent 17037270bc
commit 4eff058d5a
+2 -1
View File
@@ -22,6 +22,7 @@
$oldname = optional_param('oldname', '', PARAM_FILE);
$usecheckboxes = optional_param('usecheckboxes', 1, PARAM_INT);
$save = optional_param('save', 0, PARAM_BOOL);
$text = optional_param('text', '', PARAM_RAW);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
@@ -393,7 +394,7 @@
case "edit":
html_header($course, $wdir);
if (isset($text) and confirm_sesskey()) {
if (($text != '') and confirm_sesskey()) {
$fileptr = fopen($basedir.$file,"w");
fputs($fileptr, stripslashes($text));
fclose($fileptr);