mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-20169 fixed coding style, parameter type required
This commit is contained in:
parent
622365d2e1
commit
92ebcabeb3
16 changed files with 48 additions and 48 deletions
|
@ -261,7 +261,7 @@ function hotpot_set_attempt_details(&$attempt) {
|
|||
$responsevalue[$key] = clean_param($value, PARAM_CLEAN);
|
||||
}
|
||||
} else {
|
||||
$responsevalue = optional_param($responsefield, '');
|
||||
$responsevalue = optional_param($responsefield, '', PARAM_CLEAN);
|
||||
}
|
||||
if (is_array($responsevalue)) {
|
||||
// incomplete jquiz multi-select
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
break;
|
||||
case 'update':
|
||||
if (confirm_sesskey() and $form = data_submitted()) {
|
||||
if (optional_param('cancel', 0)) {
|
||||
if (optional_param('cancel', 0, PARAM_RAW)) {
|
||||
redirect("$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id");
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
} else if ($lesson->highscores and !$lesson->practice and !optional_param('viewed', 0) and empty($pageid)) {
|
||||
} else if ($lesson->highscores and !$lesson->practice and !optional_param('viewed', 0, PARAM_INT) and empty($pageid)) {
|
||||
// Display high scores before starting lesson
|
||||
redirect("$CFG->wwwroot/mod/lesson/highscores.php?id=$cm->id");
|
||||
}
|
||||
|
|
|
@ -311,7 +311,7 @@ if ((optional_param('addrandom', false, PARAM_BOOL) || $newrandomcategory) && co
|
|||
redirect($thispageurl);
|
||||
}
|
||||
|
||||
if (optional_param('addnewpagesafterselected', null) && !empty($selectedquestionids) && confirm_sesskey()) {
|
||||
if (optional_param('addnewpagesafterselected', null, PARAM_CLEAN) && !empty($selectedquestionids) && confirm_sesskey()) {
|
||||
foreach ($selectedquestionids as $questionid) {
|
||||
$quiz->questions = quiz_add_page_break_after($quiz->questions, $questionid);
|
||||
}
|
||||
|
|
|
@ -785,10 +785,10 @@ function ewiki_page_view($id, &$data, $action, $all=1) {
|
|||
further whenever desired
|
||||
*/
|
||||
function ewiki_id() {
|
||||
($id = optional_param("id", '')) or
|
||||
($id = optional_param("name", '')) or
|
||||
($id = optional_param("page", '')) or
|
||||
($id = optional_param("file", '')) or
|
||||
($id = optional_param("id", '', PARAM_CLEAN)) or
|
||||
($id = optional_param("name", '', PARAM_CLEAN)) or
|
||||
($id = optional_param("page", '', PARAM_CLEAN)) or
|
||||
($id = optional_param("file", '', PARAM_CLEAN)) or
|
||||
(EWIKI_USE_PATH_INFO) and ($id = ltrim(@$_SERVER["PATH_INFO"], "/")) or
|
||||
(!isset($_REQUEST["id"])) and ($id = trim(strtok($_SERVER["QUERY_STRING"], "&")));
|
||||
if (!strlen($id) || ($id=="id=")) {
|
||||
|
@ -1544,8 +1544,8 @@ function ewiki_data_update(&$data, $author="") {
|
|||
function ewiki_page_edit_form(&$id, &$data, &$hidden_postdata) {
|
||||
global $ewiki_plugins, $ewiki_config, $moodle_format;
|
||||
|
||||
$content = optional_param('content', '');
|
||||
$version = optional_param('version', '');
|
||||
$content = optional_param('content', '', PARAM_CLEAN);
|
||||
$version = optional_param('version', '', PARAM_CLEAN);
|
||||
|
||||
$o='';
|
||||
|
||||
|
@ -2562,7 +2562,7 @@ function ewiki_binary($break=0) {
|
|||
global $ewiki_plugins;
|
||||
global $USER; // MOODLE
|
||||
|
||||
$id = optional_param(EWIKI_UP_BINARY, '');
|
||||
$id = optional_param(EWIKI_UP_BINARY, '', PARAM_CLEAN);
|
||||
|
||||
#-- reject calls
|
||||
if (!strlen($id) || !EWIKI_IDF_INTERNAL) {
|
||||
|
|
|
@ -235,7 +235,7 @@
|
|||
|
||||
global $ewiki_config;
|
||||
|
||||
$ewiki_up_requestlv = optional_param(EWIKI_UP_REQUESTLV, 0);
|
||||
$ewiki_up_requestlv = optional_param(EWIKI_UP_REQUESTLV, 0, PARAM_CLEAN);
|
||||
|
||||
$html = "";
|
||||
srand(time()/17-1000*microtime());
|
||||
|
|
|
@ -144,7 +144,7 @@ function ewiki_page_fileupload($id, $data, $action, $def_sec="") {
|
|||
if (($s = $upload_file["name"]) && (strlen($s) >= 3)
|
||||
|| ($s = substr(md5(time()+microtime()),0,8) . ".dat"))
|
||||
{
|
||||
if (strlen($uu = trim(optional_param("new_filename",''))) >= 3) {
|
||||
if (strlen($uu = trim(optional_param("new_filename",'', PARAM_FILE))) >= 3) {
|
||||
if ($uu != $s) {
|
||||
$meta["Original-Filename"] = $s;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ function ewiki_page_fileupload($id, $data, $action, $def_sec="") {
|
|||
($p = strrpos($s, '\\')) and ($p++);
|
||||
$meta["Content-Disposition"] = 'attachment; filename="'.urlencode(substr($s, $p)).'"';
|
||||
}
|
||||
if (strlen($sect = optional_param("section",''))) {
|
||||
if (strlen($sect = optional_param("section",'', PARAM_CLEAN))) {
|
||||
if ($ewiki_upload_sections[$sect]
|
||||
|| ($action==EWIKI_ACTION_ATTACHMENTS) && ($data["content"])
|
||||
&& strlen($ewiki_plugins["action"][EWIKI_ACTION_ATTACHMENTS])) {
|
||||
|
@ -168,7 +168,7 @@ function ewiki_page_fileupload($id, $data, $action, $def_sec="") {
|
|||
return($o);
|
||||
}
|
||||
}
|
||||
if (strlen($s = trim(optional_param("comment",'')))) {
|
||||
if (strlen($s = trim(optional_param("comment",'', PARAM_CLEAN)))) {
|
||||
$meta["comment"] = $s;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ function moodle_ewiki_page_wiki_dump($id=0, $data=0, $action=0) {
|
|||
$cont=ewiki_page_wiki_dump_send($binaries,
|
||||
$exportformatval,
|
||||
$withvirtualpages,
|
||||
optional_param("exportdestinations", null));
|
||||
optional_param("exportdestinations", null,PARAM_CLEAN));
|
||||
}
|
||||
if($cont===false) {
|
||||
die;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue