Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-28725 wiki: added urlencode around the section variable when it i…

…s being used to construct URLs
  • Loading branch information...
commit a00b84e864ed3b855f7ee2be5d9d76688dc05bb0 1 parent 667ffef
@andyjdavis andyjdavis authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 mod/wiki/pagelib.php
View
12 mod/wiki/pagelib.php
@@ -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 . '">';
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.