Fixed Hooks only to process pags in wanted namespaces. Fixes ugly autolinking in Sidebar and breaking imagepages

This commit is contained in:
c0nnex
2015-10-02 02:44:42 +02:00
parent 124e92aafd
commit dca10de21f

View File

@ -79,10 +79,16 @@
if ( ! $isMinor ) {
$title = $wikiPage->getTitle();
// Only process if page is in one of our namespaces we want to link
// Fixes ugly autolinking of sidebar pages
if (in_array($title->getNamespace(),$wgLinkTitlesNamespaces))
{
$text = $content->getContentHandler()->serializeContent($content);
$newText = self::parseContent( $title, $text );
if ( $newText != $text ) {
$content = $content->getContentHandler()->unserializeContent( $newText );
}
}
};
return true;
@ -93,7 +99,13 @@
/// @param $text Preprocessed text of the page.
public static function onInternalParseBeforeLinks( Parser &$parser, &$text ) {
$title = $parser->getTitle();
// Only process if page is in one of our namespaces we want to link
// Fixes ugly autolinking of sidebar pages
if (in_array($title->getNamespace(),$wgLinkTitlesNamespaces))
{
$text = self::parseContent( $title, $text );
}
return true;
}