From d2b322ae3cf2551961876cf38488abce9c73ec0d Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Thu, 17 Mar 2011 20:43:35 +0100 Subject: [PATCH] MDL-26825 do not return any form data if form cancelled --- lib/formslib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/formslib.php b/lib/formslib.php index ab03871cbbb..f23d6ff56c3 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -476,12 +476,12 @@ abstract class moodleform { * * note: $slashed param removed * - * @return object submitted data; NULL if not valid or not submitted + * @return object submitted data; NULL if not valid or not submitted or cancelled */ function get_data() { $mform =& $this->_form; - if ($this->is_submitted() and $this->is_validated()) { + if (!$this->is_cancelled() and $this->is_submitted() and $this->is_validated()) { $data = $mform->exportValues(); unset($data['sesskey']); // we do not need to return sesskey unset($data['_qf__'.$this->_formname]); // we do not need the submission marker too