MDL-28725 wiki: added urlencode around the section variable when it is being used to construct URLs

This commit is contained in:
Andrew Davis (andyjdavis)
2011-09-29 14:57:28 +08:00
parent 41017112cf
commit 1323bf5597
+6 -6
View File
@@ -477,7 +477,7 @@ class page_wiki_edit extends page_wiki {
$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 @@ class page_wiki_edit extends page_wiki {
$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 @@ class page_wiki_preview extends page_wiki_edit {
$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 @@ class page_wiki_save extends page_wiki_edit {
$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 @@ class page_wiki_overridelocks extends page_wiki_edit {
$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 @@ class page_wiki_overridelocks extends page_wiki_edit {
$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);