From 0549198cf0e97c267cb78eb08118b33be034792f Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 4 May 2005 18:25:35 +0000 Subject: [PATCH] A fix for kses problems with quotes ... --- lib/moodlelib.php | 3 +++ lib/weblib.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 34cdfa8d0ba..bca7b816f06 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -194,6 +194,9 @@ function clean_param($param, $options) { if ($options & PARAM_CLEAN) { $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 } if ($options & PARAM_INT) { diff --git a/lib/weblib.php b/lib/weblib.php index ed638382f14..ab209ccb0cb 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1269,7 +1269,7 @@ function cleanAttributes2($htmlTag){ global $CFG, $ALLOWED_PROTOCOLS; require_once($CFG->libdir .'/kses.php'); - $htmlTag = kses_stripslashes($htmlTag); + $htmlTag = str_replace('\\\\"', '"', $htmlTag); if (substr($htmlTag, 0, 1) != '<') { return '>'; //a single character ">" detected }