Skip to content

Commit

Permalink
MDL-19976 Changing redirect($url->out()) to redirect($url). NEVER, NE…
Browse files Browse the repository at this point in the history
…VER use redirect($url->out())!!! Bad Tim! :p
  • Loading branch information
nicolasconnault committed Jul 31, 2009
1 parent e530f3a commit e42f153
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/listlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ function process_actions($left, $right, $moveup, $movedown) {
return false;
}

redirect($this->pageurl->out());
redirect($this->pageurl);
}

/**
Expand Down
24 changes: 12 additions & 12 deletions mod/quiz/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
if (($up = optional_param('up', false, PARAM_INT)) && confirm_sesskey()) {
$quiz->questions = quiz_move_question_up($quiz->questions, $up);
quiz_save_new_layout($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

if (($down = optional_param('down', false, PARAM_INT)) && confirm_sesskey()) {
$quiz->questions = quiz_move_question_down($quiz->questions, $down);
quiz_save_new_layout($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

if (optional_param('repaginate', false, PARAM_BOOL) && confirm_sesskey()) {
Expand All @@ -212,7 +212,7 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
quiz_add_quiz_question($addquestion, $quiz, $addonpage);
quiz_update_sumgrades($quiz);
quiz_delete_previews($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

if (optional_param('add', false, PARAM_BOOL) && confirm_sesskey()) {
Expand All @@ -226,7 +226,7 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
}
quiz_update_sumgrades($quiz);
quiz_delete_previews($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

$qcobject = new question_category_object($pagevars['cpage'], $thispageurl,
Expand Down Expand Up @@ -307,37 +307,37 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo

quiz_update_sumgrades($quiz);
quiz_delete_previews($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

if (optional_param('addnewpagesafterselected', null) && !empty($selectedquestionids) && confirm_sesskey()) {
foreach ($selectedquestionids as $questionid) {
$quiz->questions = quiz_add_page_break_after($quiz->questions, $questionid);
}
quiz_save_new_layout($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

$addpage = optional_param('addpage', false, PARAM_INT);
if ($addpage !== false && confirm_sesskey()) {
$quiz->questions = quiz_add_page_break_at($quiz->questions, $addpage);
quiz_save_new_layout($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

$deleteemptypage = optional_param('deleteemptypage', false, PARAM_INT);
if (($deleteemptypage !== false) && confirm_sesskey()) {
$quiz->questions = quiz_delete_empty_page($quiz->questions, $deleteemptypage);
quiz_save_new_layout($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

$remove = optional_param('remove', false, PARAM_INT);
if (($remove = optional_param('remove', false, PARAM_INT)) && confirm_sesskey()) {
quiz_remove_question($quiz, $remove);
quiz_update_sumgrades($quiz);
quiz_delete_previews($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

if (optional_param('quizdeleteselected', false, PARAM_BOOL) && !empty($selectedquestionids) && confirm_sesskey()) {
Expand All @@ -346,7 +346,7 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
}
quiz_update_sumgrades($quiz);
quiz_delete_previews($quiz);
redirect($thispageurl->out());
redirect($thispageurl);
}

if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
Expand Down Expand Up @@ -426,7 +426,7 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
quiz_set_grade($maxgrade, $quiz);
}

redirect($thispageurl->out());
redirect($thispageurl);
}

$questionbank->process_actions($thispageurl, $cm);
Expand Down Expand Up @@ -593,4 +593,4 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
<?php
}
print_footer($course);
?>
?>
2 changes: 1 addition & 1 deletion mod/quiz/report/overview/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function display($quiz, $cm, $course) {
$this->regrade_all_needed($quiz, $groupstudents);
}
if ($regradeall || $regradealldry || $regradealldrydo){
redirect($reporturl->out(false, $displayoptions), '', 5);
redirect($reporturl->out(false, $displayoptions, false), '', 5);
}

if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/report/statistics/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function display($quiz, $cm, $course) {
print_error('errordeleting', 'quiz_statistics', '', 'quiz_question_response_stats');
}
}
redirect($reporturl->out());
redirect($reporturl);
}


Expand Down
10 changes: 5 additions & 5 deletions question/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,30 @@
$qcobject->moveform = new question_move_form($thispageurl,
array('contexts'=>array($categorycontext), 'currentcat'=>$param->delete));
if ($qcobject->moveform->is_cancelled()){
redirect($thispageurl->out());
redirect($thispageurl);
} elseif ($formdata = $qcobject->moveform->get_data()) {
/// 'confirm' is the category to move existing questions to
list($tocategoryid, $tocontextid) = explode(',', $formdata->category);
$qcobject->move_questions_and_delete_category($formdata->delete, $tocategoryid);
$thispageurl->remove_params('cat', 'category');
redirect($thispageurl->out());
redirect($thispageurl);
}
} else {
$questionstomove = 0;
}
if ($qcobject->catform->is_cancelled()) {
redirect($thispageurl->out());
redirect($thispageurl);
} else if ($catformdata = $qcobject->catform->get_data()) {
if (!$catformdata->id) {//new category
$qcobject->add_category($catformdata->parent, $catformdata->name, $catformdata->info);
} else {
$qcobject->update_category($catformdata->id, $catformdata->parent, $catformdata->name, $catformdata->info);
}
redirect($thispageurl->out());
redirect($thispageurl);
} else if ((!empty($param->delete) and (!$questionstomove) and confirm_sesskey())) {
$qcobject->delete_category($param->delete);//delete the category now no questions to move
$thispageurl->remove_params('cat', 'category');
redirect($thispageurl->out());
redirect($thispageurl);
}
$navlinks = array();
if ($cm!==null) {
Expand Down
4 changes: 2 additions & 2 deletions question/category_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public function add_category($newparent, $newcategory, $newinfo, $return=false)
if ($return) {
return $categoryid;
} else {
redirect($this->pageurl->out());//always redirect after successful action
redirect($this->pageurl);//always redirect after successful action
}
}

Expand Down Expand Up @@ -469,7 +469,7 @@ public function update_category($updateid, $newparent, $newname, $newinfo) {

// Then redirect to an appropriate place.
if ($oldcat->contextid == $tocontextid) { // not moving contexts
redirect($this->pageurl->out());
redirect($this->pageurl);
} else {
redirect($CFG->wwwroot.'/question/contextmove.php?' .
$this->pageurl->get_query_string(array(
Expand Down
2 changes: 1 addition & 1 deletion question/preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
unset($SESSION->quizpreview);
// Redirect to ourselves but with continue=1; prevents refreshing the page
// from restarting an attempt (needed so that random questions don't change)
redirect($url->out());
redirect($url);
}
// Load the question information
if (!$questions = $DB->get_records('question', array('id' => $id))) {
Expand Down

0 comments on commit e42f153

Please sign in to comment.