X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FContentHandler.php;h=f85b00d8ed681dd00698048cf9fbd0e084f22009;hb=b5cddfb27b0d50bd396b1ff92d022b2dec766754;hp=ed5be47704ba7a1deb00c61b2a634aa82a712067;hpb=dcfec00f3b1224081e5192d5cf6d426a3c66029c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index ed5be47704..f85b00d8ed 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -619,8 +619,8 @@ abstract class ContentHandler { */ public function createDifferenceEngine( IContextSource $context, $old = 0, $new = 0, $rcid = 0, // FIXME: Deprecated, no longer used - $refreshCache = false, $unhide = false ) { - + $refreshCache = false, $unhide = false + ) { // hook: get difference engine $differenceEngine = null; if ( !Hooks::run( 'GetDifferenceEngine', @@ -1007,22 +1007,22 @@ abstract class ContentHandler { * @return ParserOptions */ public function makeParserOptions( $context ) { - global $wgContLang, $wgEnableParserLimitReporting; + global $wgContLang; if ( $context instanceof IContextSource ) { - $options = ParserOptions::newFromContext( $context ); + $user = $context->getUser(); + $lang = $context->getLanguage(); } elseif ( $context instanceof User ) { // settings per user (even anons) - $options = ParserOptions::newFromUser( $context ); + $user = $context; + $lang = null; } elseif ( $context === 'canonical' ) { // canonical settings - $options = ParserOptions::newFromUserAndLang( new User, $wgContLang ); + $user = new User; + $lang = $wgContLang; } else { throw new MWException( "Bad context for parser options: $context" ); } - $options->enableLimitReport( $wgEnableParserLimitReporting ); // show inclusion/loop reports - $options->setTidy( true ); // fix bad HTML - - return $options; + return ParserOptions::newCanonical( $user, $lang ); } /** @@ -1157,8 +1157,11 @@ abstract class ContentHandler { * @return array Map of name=>value for fields * @since 1.28 */ - public function getDataForSearchIndex( WikiPage $page, ParserOutput $output, - SearchEngine $engine ) { + public function getDataForSearchIndex( + WikiPage $page, + ParserOutput $output, + SearchEngine $engine + ) { $fieldData = []; $content = $page->getContent();