Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-28725 wiki: added urlencode around the section variable when it i…
…s being used to construct URLs
  • Loading branch information
andyjdavis committed Sep 29, 2011
1 parent 667ffef commit a00b84e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mod/wiki/pagelib.php
Expand Up @@ -477,7 +477,7 @@ protected function check_locks() {
$params = 'pageid=' . $this->page->id; $params = 'pageid=' . $this->page->id;


if ($this->section) { if ($this->section) {
$params .= '&section=' . $this->section; $params .= '&section=' . urlencode($this->section);
} }


$form = '<form method="post" action="' . $CFG->wwwroot . '/mod/wiki/overridelocks.php?' . $params . '">'; $form = '<form method="post" action="' . $CFG->wwwroot . '/mod/wiki/overridelocks.php?' . $params . '">';
Expand Down Expand Up @@ -523,7 +523,7 @@ protected function print_edit($content = null) {


$url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id; $url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id;
if (!empty($this->section)) { if (!empty($this->section)) {
$url .= "&section=" . $this->section; $url .= "&section=" . urlencode($this->section);
} }


$params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $version->contentformat, 'version' => $versionnumber, 'pagetitle'=>$this->page->title); $params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $version->contentformat, 'version' => $versionnumber, 'pagetitle'=>$this->page->title);
Expand Down Expand Up @@ -990,7 +990,7 @@ protected function print_preview() {


$url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id; $url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id;
if (!empty($this->section)) { if (!empty($this->section)) {
$url .= "&section=" . $this->section; $url .= "&section=" . urlencode($this->section);
} }
$params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $this->format, 'version' => $this->versionnumber); $params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $this->format, 'version' => $this->versionnumber);


Expand Down Expand Up @@ -1980,7 +1980,7 @@ protected function print_save() {


$url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id; $url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id;
if (!empty($this->section)) { if (!empty($this->section)) {
$url .= "&section=" . $this->section; $url .= "&section=" . urlencode($this->section);
} }


$params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $this->format, 'version' => $this->versionnumber); $params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $this->format, 'version' => $this->versionnumber);
Expand Down Expand Up @@ -2305,7 +2305,7 @@ function print_content() {
$args = "pageid=" . $this->page->id; $args = "pageid=" . $this->page->id;


if (!empty($this->section)) { if (!empty($this->section)) {
$args .= "&section=" . $this->section; $args .= "&section=" . urlencode($this->section);
} }


redirect($CFG->wwwroot . '/mod/wiki/edit.php?' . $args, get_string('overridinglocks', 'wiki'), 2); redirect($CFG->wwwroot . '/mod/wiki/edit.php?' . $args, get_string('overridinglocks', 'wiki'), 2);
Expand Down Expand Up @@ -2334,7 +2334,7 @@ private function print_overridelocks() {
$args = "pageid=" . $this->page->id; $args = "pageid=" . $this->page->id;


if (!empty($this->section)) { if (!empty($this->section)) {
$args .= "&section=" . $this->section; $args .= "&section=" . urlencode($this->section);
} }


redirect($CFG->wwwroot . '/mod/wiki/edit.php?' . $args, get_string('overridinglocks', 'wiki'), 2); redirect($CFG->wwwroot . '/mod/wiki/edit.php?' . $args, get_string('overridinglocks', 'wiki'), 2);
Expand Down

0 comments on commit a00b84e

Please sign in to comment.