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:
stronk7
2005-05-04 23:09:43 +00:00
parent dfe7177827
commit 4e8f2e6ba3
2 changed files with 9 additions and 9 deletions
+2 -3
View File
@@ -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) {