Skip to content

Commit

Permalink
MDL-35991 - use PARAM_LOCALURL for local urls
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncoggins authored and danpoltawski committed Jan 7, 2013
1 parent f7551c2 commit fd1d829
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backup/backupfilesedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// file parameters
$component = optional_param('component', null, PARAM_COMPONENT);
$filearea = optional_param('filearea', null, PARAM_AREA);
$returnurl = optional_param('returnurl', null, PARAM_URL);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);

list($context, $course, $cm) = get_context_info_array($currentcontext);
$filecontext = context::instance_by_id($contextid, IGNORE_MISSING);
Expand Down
2 changes: 1 addition & 1 deletion comment/comment_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$area = optional_param('area', '', PARAM_AREA);
$content = optional_param('content', '', PARAM_RAW);
$itemid = optional_param('itemid', '', PARAM_INT);
$returnurl = optional_param('returnurl', '/', PARAM_URL);
$returnurl = optional_param('returnurl', '/', PARAM_LOCALURL);
$component = optional_param('component', '', PARAM_COMPONENT);

// Currently this script can only add comments
Expand Down
4 changes: 2 additions & 2 deletions course/switchrole.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

$id = required_param('id', PARAM_INT);
$switchrole = optional_param('switchrole',-1, PARAM_INT);
$returnurl = optional_param('returnurl', false, PARAM_URL);
$returnurl = optional_param('returnurl', false, PARAM_LOCALURL);

$PAGE->set_url('/course/switchrole.php', array('id'=>$id));

Expand Down Expand Up @@ -84,4 +84,4 @@
$returnurl = new moodle_url('/course/view.php', array('id' => $course->id));
}

redirect($returnurl);
redirect($returnurl);
2 changes: 1 addition & 1 deletion mod/wiki/filesedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$subwikiid = required_param('subwiki', PARAM_INT);
// not being used for file management, we use it to generate navbar link
$pageid = optional_param('pageid', 0, PARAM_INT);
$returnurl = optional_param('returnurl', '', PARAM_URL);
$returnurl = optional_param('returnurl', '', PARAM_LOCALURL);

if (!$subwiki = wiki_get_subwiki($subwikiid)) {
print_error('incorrectsubwikiid', 'wiki');
Expand Down
2 changes: 1 addition & 1 deletion tag/coursetags_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
print_error('tagsaredisabled', 'tag');
}

$returnurl = optional_param('returnurl', null, PARAM_TEXT);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
$keyword = optional_param('coursetag_new_tag', '', PARAM_TEXT);
$courseid = optional_param('entryid', 0, PARAM_INT);
$userid = optional_param('userid', 0, PARAM_INT);
Expand Down
2 changes: 1 addition & 1 deletion user/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
die();
}

$returnurl = optional_param('returnurl', '', PARAM_URL);
$returnurl = optional_param('returnurl', '', PARAM_LOCALURL);

if (empty($returnurl)) {
$returnurl = new moodle_url('/user/files.php');
Expand Down

0 comments on commit fd1d829

Please sign in to comment.