diff --git a/lib/blocklib.php b/lib/blocklib.php index 045c652fcea..3931dbeed9f 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -897,7 +897,7 @@ class block_manager { // it is shortened because some web servers (e.g. IIS by default) give // a 'security' error if you try to pass a full URL as a GET parameter in another URL. - $return = $this->out(false, array(), false); + $return = $this->out_raw(); $return = str_replace($CFG->wwwroot . '/', '', $return); $controls[] = array('url' => $CFG->wwwroot . '/' . $CFG->admin . diff --git a/lib/editor/tinymce/lib.php b/lib/editor/tinymce/lib.php index 0b93e7996ca..1547722a38e 100644 --- a/lib/editor/tinymce/lib.php +++ b/lib/editor/tinymce/lib.php @@ -75,7 +75,7 @@ class tinymce_texteditor extends texteditor { $strtime = get_string('strftimetime'); $strdate = get_string('strftimedaydate'); $lang = str_replace('_utf8', '', current_language()); // use more standard language codes - $contentcss = $PAGE->theme->editor_css_url()->out(false, array(), false); + $contentcss = $PAGE->theme->editor_css_url()->out_raw(); $context = empty($options['context']) ? get_context_instance(CONTEXT_SYSTEM) : $options['context']; if (!empty($options['legacy'])) { diff --git a/lib/outputactions.php b/lib/outputactions.php index a6b44a91cf5..6e33f385060 100644 --- a/lib/outputactions.php +++ b/lib/outputactions.php @@ -132,7 +132,7 @@ class popup_action extends component_action { $this->params[$var] = $params[$var]; } } - parent::__construct($event, 'openpopup', array('url' => $url->out(false, array(), false), 'name' => $name, 'options' => $this->get_js_options($params))); + parent::__construct($event, 'openpopup', array('url' => $url->out_raw(), 'name' => $name, 'options' => $this->get_js_options($params))); } /** diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 4265440e117..8ddf06d4e53 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -740,7 +740,7 @@ class core_renderer extends renderer_base { foreach ($controls as $control) { $controlshtml[] = html_writer::tag('a', array('class' => 'icon', 'title' => $control['caption'], 'href' => $control['url']), - html_writer::empty_tag('img', array('src' => $this->pix_url($control['icon'])->out(false, array(), false), + html_writer::empty_tag('img', array('src' => $this->pix_url($control['icon'])->out_raw(), 'alt' => $control['caption']))); } return html_writer::tag('div', array('class' => 'commands'), implode('', $controlshtml)); @@ -820,7 +820,7 @@ class core_renderer extends renderer_base { $plaintitle = strip_tags($bc->title); $this->page->requires->js_function_call('new block_hider', array($bc->id, $userpref, get_string('hideblocka', 'access', $plaintitle), get_string('showblocka', 'access', $plaintitle), - $this->pix_url('t/switch_minus')->out(false, array(), false), $this->pix_url('t/switch_plus')->out(false, array(), false))); + $this->pix_url('t/switch_minus')->out_raw(), $this->pix_url('t/switch_plus')->out_raw())); } } diff --git a/lib/pagelib.php b/lib/pagelib.php index d6ad362f58b..873ab466263 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -999,7 +999,7 @@ class moodle_page { if (empty($this->_block_actions_done)) { $this->_block_actions_done = true; if ($this->blocks->process_url_actions($this)) { - redirect($this->url->out(false, array(), false)); + redirect($this->url->out_raw()); } } $this->blocks->create_all_block_instances(); diff --git a/lib/portfoliolib.php b/lib/portfoliolib.php index 784f28a75df..eb84a36f7e4 100644 --- a/lib/portfoliolib.php +++ b/lib/portfoliolib.php @@ -319,7 +319,7 @@ class portfolio_add_button { } // if we just want a url to redirect to, do it now if ($format == PORTFOLIO_ADD_FAKE_URL) { - return $url->out(false, array(), false); + return $url->out_raw(); } if (empty($addstr)) { diff --git a/lib/weblib.php b/lib/weblib.php index 089d55adeff..06c10521eb9 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -647,7 +647,7 @@ function prepare_url($url, $stripformparams=false) { if (preg_match('/(.*)\/([A-Za-z0-9-_]*\.php)$/', $PAGE->url->out(true), $matches)) { return $matches[1] . "/$output"; } else if ($output == '') { - return $PAGE->url->out(false, array(), false) . '#'; + return $PAGE->url->out_raw() . '#'; } else { throw new coding_exception('Unrecognied URL scheme. Please check the formatting of the URL passed to this function. Absolute URLs are the preferred scheme.'); } @@ -2071,7 +2071,7 @@ function print_collapsible_region_start($classes, $id, $caption, $userpref = fal $output .= '
'; $PAGE->requires->js_function_call('new collapsible_region', array($id, $userpref, get_string('clicktohideshow'), - $OUTPUT->pix_url('t/collapsed')->out(false, null, false), $OUTPUT->pix_url('t/expanded')->out(false, null, false))); + $OUTPUT->pix_url('t/collapsed')->out_raw(), $OUTPUT->pix_url('t/expanded')->out_raw())); if ($return) { return $output; @@ -2475,7 +2475,7 @@ function redirect($url, $message='', $delay=-1) { global $OUTPUT, $PAGE, $SESSION, $CFG; if ($url instanceof moodle_url) { - $url = $url->out(false, array(), false); + $url = $url->out_raw(); } if (!empty($CFG->usesid) && !isset($_COOKIE[session_name()])) { diff --git a/mod/workshop/allocation/random/lib.php b/mod/workshop/allocation/random/lib.php index 96073bf8c30..5c506468f27 100644 --- a/mod/workshop/allocation/random/lib.php +++ b/mod/workshop/allocation/random/lib.php @@ -66,7 +66,7 @@ class workshop_random_allocator implements workshop_allocator { $customdata['workshop'] = $this->workshop; $this->mform = new workshop_random_allocator_form($PAGE->url, $customdata); if ($this->mform->is_cancelled()) { - redirect($PAGE->url->out(false, array(), false)); + redirect($PAGE->url->out_raw()); } else if ($settings = $this->mform->get_data()) { // process validated data if (!confirm_sesskey()) { diff --git a/question/editlib.php b/question/editlib.php index 6cdeea5ba63..c6de2f0bbd0 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -800,8 +800,9 @@ class question_bank_view { } // Create the url of the new question page to forward to. + // TODO: it is sloppy to pass around full URLs through page parameters and some servers do not like that $this->editquestionurl = new moodle_url("$CFG->wwwroot/question/question.php", - array('returnurl' => urlencode($pageurl->out(false, array(), false)))); + array('returnurl' => urlencode($pageurl->out_raw()))); if ($cm !== null){ $this->editquestionurl->param('cmid', $cm->id); } else { diff --git a/question/question.php b/question/question.php index 904c208ab64..d13af26132a 100644 --- a/question/question.php +++ b/question/question.php @@ -218,7 +218,8 @@ if ($mform->is_cancelled()){ /// Ensure we redirect back to the category the question is being saved into. $returnurl = new moodle_url($returnurl); $returnurl->param('category', $fromform->category); - $returnurl = $returnurl->out(false, array(), false); + // TODO: it is sloppy to pass arounf full URLs through page parameters and some servers do not like that + $returnurl = $returnurl->out_raw(); /// Call the appropriate method. if ($movecontext) {