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 10:34:53 +00:00
committed by Dan Poltawski
parent 14605dc0fd
commit 83cfd8a37a
+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) {