mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Merge "Fix links to sections with [[links]] in their title"
This commit is contained in:
commit
faf3bee07c
|
@ -45,13 +45,16 @@ trait EchoPresentationModelSectionTrait {
|
|||
* @return Title
|
||||
*/
|
||||
protected function getTitleWithSection() {
|
||||
global $wgParser;
|
||||
$title = $this->event->getTitle();
|
||||
$section = $this->getSection();
|
||||
// guessSectionNameFromWikiText() returns '#foo', strip the '#'
|
||||
$fragment = substr( $wgParser->guessSectionNameFromWikiText( $section ), 1 );
|
||||
if ( $section ) {
|
||||
$title = Title::makeTitle(
|
||||
$title->getNamespace(),
|
||||
$title->getDBkey(),
|
||||
$section
|
||||
$fragment
|
||||
);
|
||||
}
|
||||
return $title;
|
||||
|
|
Loading…
Reference in a new issue