merged from MOODLE_15_STABLE

This commit is contained in:
skodak
2005-07-04 20:23:53 +00:00
parent 25ef0370d5
commit 95bfd2078b
2 changed files with 5 additions and 3 deletions
+5
View File
@@ -109,6 +109,7 @@ define('PARAM_ALPHANUM', 0x0400); //numbers or letters only
define('PARAM_BOOL', 0x0800); //convert to value 1 or 0 using empty()
define('PARAM_CLEANHTML',0x1000); //actual HTML code that you want cleaned and slashes removed
define('PARAM_ALPHAEXT', 0x2000); // PARAM_ALPHA plus the chars in quotes: "/-_" allowed
define('PARAM_SAFEDIR', 0x4000); // safe directory name, suitable for include() and require()
/**
* Definition of page types
@@ -237,6 +238,10 @@ function clean_param($param, $options) {
$param = strip_tags($param);
}
if ($options & PARAM_SAFEDIR) { // Remove everything not a-zA-Z0-9_-
$param = eregi_replace('[^a-zA-Z0-9_-]', '', $param);
}
if ($options & PARAM_CLEANFILE) { // allow only safe characters
$param = clean_filename($param);
}
-3
View File
@@ -2973,9 +2973,6 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
if ($usehtmleditor) {
// cleanup bad html that may have made it to the db
$value = clean_text($value);
if (!empty($courseid) and isteacher($courseid)) {
echo ($scriptcount < 1) ? '<script type="text/javascript" src="'. $CFG->wwwroot .'/lib/editor/htmlarea.php?id='. $courseid .'"></script>'."\n" : '';
} else {