X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FContentHandler.php;h=65a7b7daac88f9e57a4e25a56184842bd77ec874;hb=5ecb8b3ac68de658e65fe69c6b6a1c2d8b14605f;hp=ae47b860566b278dc1e6ff2666fcaffca2aa1374;hpb=70d9fbb0bfacaf837b7e8efb3770245d646ab522;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index ae47b86056..65a7b7daac 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -1,4 +1,5 @@ getNativeData(). + * text as returned by $content->getText(). * * If $content is not a TextContent object, the behavior of this method * depends on the global $wgContentHandlerTextFallback: @@ -645,9 +646,6 @@ abstract class ContentHandler { $slotDiffRenderer->setStatsdDataFactory( $statsdDataFactory ); // XXX using the page language would be better, but it's unclear how that should be injected $slotDiffRenderer->setLanguage( $contentLanguage ); - $slotDiffRenderer->setWikiDiff2MovedParagraphDetectionCutoff( - $context->getConfig()->get( 'WikiDiff2MovedParagraphDetectionCutoff' ) - ); $engine = DifferenceEngine::getEngine(); if ( $engine === false ) { @@ -667,7 +665,7 @@ abstract class ContentHandler { * This default implementation just returns the content language (except for pages * in the MediaWiki namespace) * - * Note that the pages language is not cacheable, since it may in some + * Note that the page's language is not cacheable, since it may in some * cases depend on user settings. * * Also note that the page language may or may not depend on the actual content of the page, @@ -684,12 +682,16 @@ abstract class ContentHandler { global $wgLang; $pageLang = MediaWikiServices::getInstance()->getContentLanguage(); - if ( $title->getNamespace() == NS_MEDIAWIKI ) { + if ( $title->inNamespace( NS_MEDIAWIKI ) ) { // Parse mediawiki messages with correct target language list( /* $unused */, $lang ) = MessageCache::singleton()->figureMessage( $title->getText() ); $pageLang = Language::factory( $lang ); } + // Simplify hook handlers by only passing objects of one type, in case nothing + // else has unstubbed the StubUserLang object by now. + StubObject::unstub( $wgLang ); + Hooks::run( 'PageContentLanguage', [ $title, &$pageLang, $wgLang ] ); return wfGetLangObj( $pageLang );