Skip to content

Commit

Permalink
MDL-28725 wiki: added urlencode around the section variable when it i…
Browse files Browse the repository at this point in the history
…s being used to construct URLs
  • Loading branch information
andyjdavis committed Sep 29, 2011
1 parent 3f1ef9e commit a80c9b9
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;

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

$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;
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);
Expand Down Expand Up @@ -990,7 +990,7 @@ protected function print_preview() {

$url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id;
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);

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

$url = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $this->page->id;
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);
Expand Down Expand Up @@ -2305,7 +2305,7 @@ function print_content() {
$args = "pageid=" . $this->page->id;

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);
Expand Down Expand Up @@ -2334,7 +2334,7 @@ private function print_overridelocks() {
$args = "pageid=" . $this->page->id;

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);
Expand Down

0 comments on commit a80c9b9

Please sign in to comment.