Changed call from preg_replace() to preg_replace_callback() to avoid
some double backslashes present yet. This method doesn't addslashes() automatically like the old one (so kses_stripslashes() is not needed). All we have to to is to stripslashes() before calling kses and addslashes() after it. Only in clean_param(), because params arrive always slashed to Moodle. This seems to be the correct approach documented in: http://sourceforge.net/project/shownotes.php?group_id=81853&release_id=302996
This commit is contained in:
+2
-3
@@ -193,10 +193,9 @@ function clean_param($param, $options) {
|
||||
}
|
||||
|
||||
if ($options & PARAM_CLEAN) {
|
||||
$param = stripslashes($param);
|
||||
$param = clean_text($param); // Sweep for scripts, etc
|
||||
$param = str_replace('"', '\\\\"', $param); // Because clean_text will strip them
|
||||
// when checking HTML tags ... I'm not
|
||||
// sure if this is really necessary to replace
|
||||
$param = addslashes($param);
|
||||
}
|
||||
|
||||
if ($options & PARAM_INT) {
|
||||
|
||||
Reference in New Issue
Block a user