Skip to content
Browse files

Merge branch 'MDL-37896_23' of git://github.com/timhunt/moodle into M…

…OODLE_23_STABLE
  • Loading branch information...
2 parents 473b153 + 772979e commit 596881dbafbf85e99b3628c07209557611212612 @stronk7 stronk7 committed Feb 12, 2013
Showing with 9 additions and 7 deletions.
  1. +5 −1 lib/moodlelib.php
  2. +3 −3 question/engine/questionattempt.php
  3. +1 −3 question/type/essay/question.php
View
6 lib/moodlelib.php
@@ -116,7 +116,11 @@
define('PARAM_CAPABILITY', 'capability');
/**
- * PARAM_CLEANHTML - cleans submitted HTML code. use only for text in HTML format. This cleaning may fix xhtml strictness too.
+ * PARAM_CLEANHTML - cleans submitted HTML code. Note that you almost never want
+ * to use this. The normal mode of operation is to use PARAM_RAW when recieving
+ * the input (required/optional_param or formslib) and then sanitse the HTML
+ * using format_text on output. This is for the rare cases when you want to
+ * sanitise the HTML on input. This cleaning may also fix xhtml strictness.
*/
define('PARAM_CLEANHTML', 'cleanhtml');
View
6 question/engine/questionattempt.php
@@ -64,7 +64,7 @@ class question_attempt {
* @var string special value to indicate a response variable that is uploaded
* files.
*/
- const PARAM_CLEANHTML_FILES = 'paramcleanhtmlfiles';
+ const PARAM_RAW_FILES = 'paramrawfiles';
/** @var integer if this attempts is stored in the question_attempts table, the id of that row. */
protected $id = null;
@@ -888,8 +888,8 @@ public function get_submitted_var($name, $type, $postdata = null) {
case self::PARAM_FILES:
return $this->process_response_files($name, $name, $postdata);
- case self::PARAM_CLEANHTML_FILES:
- $var = $this->get_submitted_var($name, PARAM_CLEANHTML, $postdata);
+ case self::PARAM_RAW_FILES:
+ $var = $this->get_submitted_var($name, PARAM_RAW, $postdata);
return $this->process_response_files($name, $name . ':itemid', $postdata, $var);
default:
View
4 question/type/essay/question.php
@@ -55,9 +55,7 @@ public function get_format_renderer(moodle_page $page) {
public function get_expected_data() {
if ($this->responseformat == 'editorfilepicker') {
- $expecteddata = array('answer' => question_attempt::PARAM_CLEANHTML_FILES);
- } else if ($this->responseformat == 'editor') {
- $expecteddata = array('answer' => PARAM_CLEANHTML);
+ $expecteddata = array('answer' => question_attempt::PARAM_RAW_FILES);
} else {
$expecteddata = array('answer' => PARAM_RAW);
}

0 comments on commit 596881d

Please sign in to comment.
Something went wrong with that request. Please try again.