MDL-29585 mod_wiki: Prevent broken links in editable sections

When a section name ended with a URL, the '<a' part of [edit] link
that is appended to the section was considered as part of the URL
in the section, thus causing the [edit] link to be broken.
This commit is contained in:
Frederic Massart
2014-11-19 17:28:36 +08:00
parent a74d4743e1
commit 414f7ef8ff
+3 -1
View File
@@ -181,7 +181,9 @@ abstract class wiki_markup_parser extends generic_parser {
$text = trim($text);
if (!$this->pretty_print && $level == 1) {
$text .= parser_utils::h('a', '['.get_string('editsection', 'wiki').']', array('href' => "edit.php?pageid={$this->wiki_page_id}&section=" . urlencode($text), 'class' => 'wiki_edit_section'));
$text .= ' ' . parser_utils::h('a', '['.get_string('editsection', 'wiki').']',
array('href' => "edit.php?pageid={$this->wiki_page_id}&section=" . urlencode($text),
'class' => 'wiki_edit_section'));
}
if ($level <= $this->maxheaderdepth) {