diff --git a/lib/form/editor.php b/lib/form/editor.php index 0f592a9..bb0da69 100755 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -34,6 +34,16 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { if (!$this->_options['context']) { $this->_options['context'] = get_context_instance(CONTEXT_SYSTEM); } + + $context = new stdClass(); + $context->id = $this->_options['context']->id; + $context->contextlevel = $this->_options['context']->contextlevel; + $context->protected = $this->_options['context']->instanceid; + $context->path = $this->_options['context']->path; + $context->depth = $this->_options['context']->depth; + $this->_options['context'] = $context; + + $this->_options['trusted'] = trusttext_trusted($this->_options['context']); parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);