From 41017112cff7f5bd7969c72d321320f3090e7c68 Mon Sep 17 00:00:00 2001 From: "Andrew Davis (andyjdavis)" Date: Fri, 2 Sep 2011 16:02:30 +0800 Subject: [PATCH 1/2] MDL-28725 wiki: added missing string AMOS BEGIN CPY [invalidsection,core_admin],[invalidsection,mod_wiki] AMOS END --- mod/wiki/lang/en/wiki.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/wiki/lang/en/wiki.php b/mod/wiki/lang/en/wiki.php index bbe4e64df4d..960803f0f53 100644 --- a/mod/wiki/lang/en/wiki.php +++ b/mod/wiki/lang/en/wiki.php @@ -93,6 +93,7 @@ $string['insertimage'] = 'Insert an image...'; $string['insertimage_help'] = 'This drop-down list will insert an image to the wiki editor. If you need to add more images to the wiki, please use "Files" tab.'; $string['invalidlock'] = 'This page is already locked by another user.'; $string['invalidparameters'] = 'Invalid parameters have been given.'; +$string['invalidsection'] = 'Invalid section.'; $string['invalidsesskey'] = 'The given sesskey is not valid. Please resend data again'; $string['individualpagedoesnotexist'] = 'Individual wiki page doesn\'t exist'; $string['javascriptdisabledlocks'] = 'Javascript is disabled on your browser and locks are not working. The changes you make may not be saved correctly.'; From 1323bf5597699833015cfd0dd5bdf528b3993304 Mon Sep 17 00:00:00 2001 From: "Andrew Davis (andyjdavis)" Date: Mon, 12 Sep 2011 21:23:22 +0800 Subject: [PATCH 2/2] MDL-28725 wiki: added urlencode around the section variable when it is being used to construct URLs --- mod/wiki/pagelib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mod/wiki/pagelib.php b/mod/wiki/pagelib.php index d706a99e5fd..59690f7aa50 100644 --- a/mod/wiki/pagelib.php +++ b/mod/wiki/pagelib.php @@ -477,7 +477,7 @@ class page_wiki_edit extends page_wiki { $params = 'pageid=' . $this->page->id; if ($this->section) { - $params .= '§ion=' . $this->section; + $params .= '§ion=' . urlencode($this->section); } $form = '
'; @@ -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 .= "§ion=" . $this->section; + $url .= "§ion=" . 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 .= "§ion=" . $this->section; + $url .= "§ion=" . 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 .= "§ion=" . $this->section; + $url .= "§ion=" . 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 .= "§ion=" . $this->section; + $args .= "§ion=" . 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 .= "§ion=" . $this->section; + $args .= "§ion=" . urlencode($this->section); } redirect($CFG->wwwroot . '/mod/wiki/edit.php?' . $args, get_string('overridinglocks', 'wiki'), 2);