Skip to content

Commit

Permalink
MDL-32942 libraries: Replaced deprecated PARAM_ACTION and PARAM_FORMA…
Browse files Browse the repository at this point in the history
…T with PARAM_ALPHANUMEXT
  • Loading branch information
Rajesh Taneja committed Jul 19, 2012
1 parent 3294034 commit 405aca3
Show file tree
Hide file tree
Showing 37 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion admin/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

$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
Expand Down
2 changes: 1 addition & 1 deletion admin/editors.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

$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
Expand Down
2 changes: 1 addition & 1 deletion admin/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion admin/environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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();
Expand Down
2 changes: 1 addition & 1 deletion admin/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion admin/licenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

$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);

////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion admin/portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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);

Expand Down
2 changes: 1 addition & 1 deletion admin/repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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);

Expand Down
2 changes: 1 addition & 1 deletion admin/roles/allow.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
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',
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/unsuproles/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions admin/webservice/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function definition() {
$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'));

Expand Down Expand Up @@ -236,7 +236,7 @@ function definition() {
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);

Expand Down
2 changes: 1 addition & 1 deletion admin/webservice/protocols.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

$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);

Expand Down
2 changes: 1 addition & 1 deletion admin/webservice/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

//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');
Expand Down
2 changes: 1 addition & 1 deletion admin/webservice/service_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

$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');
Expand Down
2 changes: 1 addition & 1 deletion admin/webservice/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
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);

Expand Down
2 changes: 1 addition & 1 deletion blog/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function definition() {

$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');
Expand Down
2 changes: 1 addition & 1 deletion enrol/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// 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)));

Expand Down
2 changes: 1 addition & 1 deletion enrol/bulkchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$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);
Expand Down
2 changes: 1 addition & 1 deletion enrol/cohort/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// 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)));

Expand Down
2 changes: 1 addition & 1 deletion enrol/instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion enrol/manual/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

// 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)));

Expand Down
2 changes: 1 addition & 1 deletion enrol/otherusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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);
Expand Down
2 changes: 1 addition & 1 deletion enrol/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
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);
Expand Down
4 changes: 2 additions & 2 deletions enrol/users_forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function definition() {
$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);
Expand Down Expand Up @@ -110,7 +110,7 @@ function definition() {
$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);
Expand Down
2 changes: 1 addition & 1 deletion grade/edit/outcome/import_outcomes_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function definition() {
$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);

Expand Down
2 changes: 2 additions & 0 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,14 @@
/**
* 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');

Expand Down
2 changes: 1 addition & 1 deletion lib/tests/performance/filtersettingsperformancetester.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
}
}

switch (optional_param('action', '', PARAM_ACTION)) {
switch (optional_param('action', '', PARAM_ALPHANUMEXT)) {
case 'setup':
require_sesskey();
if ($issetup == 0) {
Expand Down
2 changes: 1 addition & 1 deletion mod/glossary/formats.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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 !== '') {
Expand Down
2 changes: 1 addition & 1 deletion mod/lti/typessettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
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);

Expand Down
2 changes: 1 addition & 1 deletion mod/wiki/editcomments.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
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)) {
Expand Down
2 changes: 1 addition & 1 deletion mod/wiki/instancecomments.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
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);
Expand Down
2 changes: 1 addition & 1 deletion question/type/essay/question.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function get_expected_data() {
} else {
$expecteddata = array('answer' => PARAM_CLEANHTML);
}
$expecteddata['answerformat'] = PARAM_FORMAT;
$expecteddata['answerformat'] = PARAM_ALPHANUMEXT;
if ($this->attachments != 0) {
$expecteddata['attachments'] = question_attempt::PARAM_FILES;
}
Expand Down
2 changes: 1 addition & 1 deletion repository/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ protected function add_defaults() {
$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);
Expand Down
2 changes: 1 addition & 1 deletion repository/manage_instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
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);
Expand Down
4 changes: 2 additions & 2 deletions user/managetoken.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
&& 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);

Expand Down Expand Up @@ -83,7 +83,7 @@
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');
Expand Down
2 changes: 1 addition & 1 deletion user/profile/index_category_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function definition () {
$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);
Expand Down
2 changes: 1 addition & 1 deletion user/profile/index_field_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function definition () {
$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);

Expand Down

0 comments on commit 405aca3

Please sign in to comment.