changing param type for returnurl to PARAM_LOCALURL

This commit is contained in:
jamiesensei 2007-05-07 15:16:07 +00:00
parent af8ed6dcba
commit 7cd4fda6e7
2 changed files with 5 additions and 1 deletions

View File

@ -13,7 +13,7 @@ require_once(dirname(__FILE__) . '/editlib.php');
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/formslib.php');
$returnurl = optional_param('returnurl', 0, PARAM_URL);
$returnurl = optional_param('returnurl', 0, PARAM_LOCALURL);
// Read URL parameters telling us which question to edit.
$id = optional_param('id', 0, PARAM_INT); // question id

View File

@ -116,6 +116,10 @@ class question_edit_form extends moodleform {
$mform->setType('cmid', PARAM_INT);
$mform->setDefault('cmid', 0);
$mform->addElement('hidden', 'returnurl');
$mform->setType('returnurl', PARAM_LOCALURL);
$mform->setDefault('returnurl', '');
$buttonarray = array();
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
if (!empty($this->question->id)) {