MDL-26825 do not return any form data if form cancelled

This commit is contained in:
Petr Skoda
2011-03-17 20:43:35 +01:00
parent 56babbcb76
commit d2b322ae3c
+2 -2
View File
@@ -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