mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-32942 libraries: Replaced deprecated PARAM_ACTION and PARAM_FORMAT with PARAM_ALPHANUMEXT
This commit is contained in:
parent
3294034b80
commit
405aca3532
@ -18,7 +18,7 @@ $returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths
|
||||
|
||||
$PAGE->set_url($returnurl);
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$auth = optional_param('auth', '', PARAM_PLUGIN);
|
||||
|
||||
get_enabled_auth_plugins(true); // fix the list of enabled auths
|
||||
|
@ -13,7 +13,7 @@ require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageeditors";
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$editor = optional_param('editor', '', PARAM_PLUGIN);
|
||||
|
||||
// get currently installed and enabled auth plugins
|
||||
|
@ -26,7 +26,7 @@
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ACTION);
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$enrol = required_param('enrol', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
|
@ -33,7 +33,7 @@ require_once($CFG->libdir.'/environmentlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
|
||||
// Parameters
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$version = optional_param('version', '', PARAM_FILE); //
|
||||
|
||||
$extraurlparams = array();
|
||||
|
@ -34,7 +34,7 @@
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$filterpath = optional_param('filterpath', '', PARAM_PATH);
|
||||
|
||||
require_login();
|
||||
|
@ -28,7 +28,7 @@ require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managelicenses";
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$license = optional_param('license', '', PARAM_SAFEDIR);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -5,7 +5,7 @@ require_once($CFG->libdir . '/portfoliolib.php');
|
||||
require_once($CFG->libdir . '/portfolio/forms.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$portfolio = optional_param('pf', '', PARAM_FORMAT);
|
||||
$portfolio = optional_param('pf', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
|
||||
|
@ -19,7 +19,7 @@ require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$repository = optional_param('repos', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
|
||||
|
@ -28,7 +28,7 @@ require_once(dirname(__FILE__) . '/../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
|
||||
|
||||
$mode = required_param('mode', PARAM_ACTION);
|
||||
$mode = required_param('mode', PARAM_ALPHANUMEXT);
|
||||
$classformode = array(
|
||||
'assign' => 'role_allow_assign_page',
|
||||
'override' => 'role_allow_override_page',
|
||||
|
@ -27,7 +27,7 @@
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
|
||||
$syscontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
|
@ -168,7 +168,7 @@ class external_service_functions_form extends moodleform {
|
||||
$mform->setType('id', PARAM_INT);
|
||||
|
||||
$mform->addElement('hidden', 'action');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$this->add_action_buttons(true, get_string('addfunctions', 'webservice'));
|
||||
|
||||
@ -236,7 +236,7 @@ class web_service_token_form extends moodleform {
|
||||
get_string('validuntil', 'webservice'), array('optional' => true));
|
||||
|
||||
$mform->addElement('hidden', 'action');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$this->add_action_buttons(true);
|
||||
|
||||
|
@ -35,7 +35,7 @@ require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = $CFG->wwwroot . "/" . $CFG->admin . "/settings.php?section=webserviceprotocols";
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$webservice = optional_param('webservice', '', PARAM_SAFEDIR);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
|
@ -40,7 +40,7 @@ $PAGE->navbar->add(get_string('externalservice', 'webservice'));
|
||||
|
||||
//Retrieve few general parameters
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
$webservicemanager = new webservice;
|
||||
$renderer = $PAGE->get_renderer('core', 'webservice');
|
||||
|
@ -30,7 +30,7 @@ require_once('forms.php');
|
||||
|
||||
$serviceid = required_param('id', PARAM_INT);
|
||||
$functionid = optional_param('fid', 0, PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
admin_externalpage_setup('externalservicefunctions');
|
||||
|
@ -28,7 +28,7 @@ require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/webservice/forms.php');
|
||||
require_once($CFG->libdir . '/externallib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$tokenid = optional_param('tokenid', '', PARAM_SAFEDIR);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
|
@ -111,7 +111,7 @@ class blog_edit_form extends moodleform {
|
||||
|
||||
$this->add_action_buttons();
|
||||
$mform->addElement('hidden', 'action');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
$mform->setDefault('action', '');
|
||||
|
||||
$mform->addElement('hidden', 'entryid');
|
||||
|
@ -35,7 +35,7 @@ require_once("$CFG->dirroot/group/lib.php");
|
||||
|
||||
// Must have the sesskey
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$action = required_param('action', PARAM_ACTION);
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$PAGE->set_url(new moodle_url('/enrol/ajax.php', array('id'=>$id, 'action'=>$action)));
|
||||
|
||||
|
@ -32,7 +32,7 @@ require_once("$CFG->dirroot/group/lib.php");
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$bulkuserop = required_param('bulkuserop', PARAM_ALPHANUMEXT);
|
||||
$userids = required_param_array('bulkuser', PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$filter = optional_param('ifilter', 0, PARAM_INT);
|
||||
|
||||
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
||||
|
@ -35,7 +35,7 @@ require_once($CFG->dirroot.'/group/lib.php');
|
||||
|
||||
// Must have the sesskey
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$action = required_param('action', PARAM_ACTION);
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$PAGE->set_url(new moodle_url('/enrol/cohort/ajax.php', array('id'=>$id, 'action'=>$action)));
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
require('../config.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$instanceid = optional_param('instance', 0, PARAM_INT);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
|
@ -34,7 +34,7 @@ require_once($CFG->dirroot.'/group/lib.php');
|
||||
|
||||
// Must have the sesskey
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$action = required_param('action', PARAM_ACTION);
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$PAGE->set_url(new moodle_url('/enrol/ajax.php', array('id'=>$id, 'action'=>$action)));
|
||||
|
||||
|
@ -29,7 +29,7 @@ require_once("$CFG->dirroot/enrol/renderer.php");
|
||||
require_once("$CFG->dirroot/group/lib.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$filter = optional_param('ifilter', 0, PARAM_INT);
|
||||
|
||||
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
||||
|
@ -30,7 +30,7 @@ require_once("$CFG->dirroot/enrol/renderer.php");
|
||||
require_once("$CFG->dirroot/group/lib.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$filter = optional_param('ifilter', 0, PARAM_INT);
|
||||
|
||||
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
||||
|
@ -56,7 +56,7 @@ class enrol_users_assign_form extends moodleform {
|
||||
$mform->setType('user', PARAM_INT);
|
||||
|
||||
$mform->addElement('hidden', 'action');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$mform->addElement('hidden', 'ifilter');
|
||||
$mform->setType('ifilter', PARAM_ALPHA);
|
||||
@ -110,7 +110,7 @@ class enrol_users_addmember_form extends moodleform {
|
||||
$mform->setType('user', PARAM_INT);
|
||||
|
||||
$mform->addElement('hidden', 'action');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$mform->addElement('hidden', 'ifilter');
|
||||
$mform->setType('ifilter', PARAM_ALPHA);
|
||||
|
@ -36,7 +36,7 @@ class import_outcomes_form extends moodleform {
|
||||
$mform =& $this->_form;
|
||||
|
||||
$mform->addElement('hidden', 'action', 'upload');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
$mform->addElement('hidden', 'courseid', $PAGE->course->id);
|
||||
$mform->setType('id', PARAM_INT);
|
||||
|
||||
|
@ -265,12 +265,14 @@ define('PARAM_NUMBER', 'float');
|
||||
/**
|
||||
* PARAM_ACTION - deprecated alias for PARAM_ALPHANUMEXT, use for various actions in forms and urls
|
||||
* NOTE: originally alias for PARAM_APLHA
|
||||
* @deprecated since 2.0
|
||||
*/
|
||||
define('PARAM_ACTION', 'alphanumext');
|
||||
|
||||
/**
|
||||
* PARAM_FORMAT - deprecated alias for PARAM_ALPHANUMEXT, use for names of plugins, formats, etc.
|
||||
* NOTE: originally alias for PARAM_APLHA
|
||||
* @deprecated since 2.0
|
||||
*/
|
||||
define('PARAM_FORMAT', 'alphanumext');
|
||||
|
||||
|
@ -62,7 +62,7 @@ foreach ($requiredtables as $table) {
|
||||
}
|
||||
}
|
||||
|
||||
switch (optional_param('action', '', PARAM_ACTION)) {
|
||||
switch (optional_param('action', '', PARAM_ALPHANUMEXT)) {
|
||||
case 'setup':
|
||||
require_sesskey();
|
||||
if ($issetup == 0) {
|
||||
|
@ -7,7 +7,7 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once("lib.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$mode = optional_param('mode', '', PARAM_ACTION);
|
||||
$mode = optional_param('mode', '', PARAM_ALPHANUMEXT);
|
||||
|
||||
$url = new moodle_url('/mod/glossary/formats.php', array('id'=>$id));
|
||||
if ($mode !== '') {
|
||||
|
@ -53,7 +53,7 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot.'/mod/lti/edit_form.php');
|
||||
require_once($CFG->dirroot.'/mod/lti/locallib.php');
|
||||
|
||||
$action = optional_param('action', null, PARAM_ACTION);
|
||||
$action = optional_param('action', null, PARAM_ALPHANUMEXT);
|
||||
$id = optional_param('id', null, PARAM_INT);
|
||||
$tab = optional_param('tab', '', PARAM_ALPHAEXT);
|
||||
|
||||
|
@ -36,7 +36,7 @@ require_once($CFG->dirroot . '/mod/wiki/locallib.php');
|
||||
require_once($CFG->dirroot . '/mod/wiki/pagelib.php');
|
||||
|
||||
$pageid = required_param('pageid', PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$commentid = optional_param('commentid', 0, PARAM_INT);
|
||||
|
||||
if (!$page = wiki_get_page($pageid)) {
|
||||
|
@ -38,7 +38,7 @@ require_once($CFG->dirroot . "/mod/wiki/locallib.php");
|
||||
require_once($CFG->dirroot . '/mod/wiki/comments_form.php');
|
||||
|
||||
$pageid = required_param('pageid', PARAM_TEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$id = optional_param('id', 0, PARAM_INT);
|
||||
$commentid = optional_param('commentid', 0, PARAM_INT);
|
||||
$newcontent = optional_param('newcontent', '', PARAM_CLEANHTML);
|
||||
|
@ -59,7 +59,7 @@ class qtype_essay_question extends question_with_responses {
|
||||
} else {
|
||||
$expecteddata = array('answer' => PARAM_CLEANHTML);
|
||||
}
|
||||
$expecteddata['answerformat'] = PARAM_FORMAT;
|
||||
$expecteddata['answerformat'] = PARAM_ALPHANUMEXT;
|
||||
if ($this->attachments != 0) {
|
||||
$expecteddata['attachments'] = question_attempt::PARAM_FILES;
|
||||
}
|
||||
|
@ -2395,7 +2395,7 @@ final class repository_instance_form extends moodleform {
|
||||
$mform->addElement('hidden', 'edit', ($this->instance) ? $this->instance->id : 0);
|
||||
$mform->setType('edit', PARAM_INT);
|
||||
$mform->addElement('hidden', 'new', $this->plugin);
|
||||
$mform->setType('new', PARAM_FORMAT);
|
||||
$mform->setType('new', PARAM_ALPHANUMEXT);
|
||||
$mform->addElement('hidden', 'plugin', $this->plugin);
|
||||
$mform->setType('plugin', PARAM_PLUGIN);
|
||||
$mform->addElement('hidden', 'typeid', $this->typeid);
|
||||
|
@ -30,7 +30,7 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
|
||||
$edit = optional_param('edit', 0, PARAM_INT);
|
||||
$new = optional_param('new', '', PARAM_FORMAT);
|
||||
$new = optional_param('new', '', PARAM_ALPHANUMEXT);
|
||||
$delete = optional_param('delete', 0, PARAM_INT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$contextid = optional_param('contextid', 0, PARAM_INT);
|
||||
|
@ -44,7 +44,7 @@ if ( !is_siteadmin($USER->id)
|
||||
&& has_capability('moodle/webservice:createtoken', $usercontext )) {
|
||||
require($CFG->dirroot.'/webservice/lib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$tokenid = optional_param('tokenid', '', PARAM_SAFEDIR);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
@ -83,7 +83,7 @@ if ( !is_siteadmin($USER->id)
|
||||
if (!empty($CFG->enablerssfeeds)) {
|
||||
require_once($CFG->dirroot.'/lib/rsslib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$rssrenderer = $PAGE->get_renderer('core', 'rss');
|
||||
|
@ -20,7 +20,7 @@ class category_form extends moodleform {
|
||||
$mform->addElement('hidden', 'id');
|
||||
$mform->setType('id', PARAM_INT);
|
||||
$mform->addElement('hidden', 'action', 'editcategory');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
|
||||
$mform->addElement('text', 'name', get_string('profilecategoryname', 'admin'), 'maxlength="255" size="30"');
|
||||
$mform->setType('name', PARAM_MULTILANG);
|
||||
|
@ -28,7 +28,7 @@ class field_form extends moodleform {
|
||||
$mform->addElement('hidden', 'id');
|
||||
$mform->setType('id', PARAM_INT);
|
||||
$mform->addElement('hidden', 'action', 'editfield');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
$mform->setType('action', PARAM_ALPHANUMEXT);
|
||||
$mform->addElement('hidden', 'datatype', $datatype);
|
||||
$mform->setType('datatype', PARAM_ALPHA);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user