X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=20b2c3c32da3025303e43998e077eba4bc09555e;hb=439b819faf168c67b7381083c244a5d5610f85bb;hp=52161466a6cc8141b3d47b913abb6007f7512f0e;hpb=fb291fe9d31cba69ae8cebeb5ba04f76f35d7816;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 52161466a6..20b2c3c32d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1852,7 +1852,7 @@ class OutputPage extends ContextSource { // Avoid PHP 7.1 warning of passing $this by reference $outputPage = $this; Hooks::run( 'LanguageLinks', [ $this->getTitle(), &$this->mLanguageLinks, &$linkFlags ] ); - Hooks::run( 'OutputPageParserOutput', [ &$outputPage, $parserOutput ] ); + Hooks::runWithoutAbort( 'OutputPageParserOutput', [ &$outputPage, $parserOutput ] ); // This check must be after 'OutputPageParserOutput' runs in addParserOutputMetadata // so that extensions may modify ParserOutput to toggle TOC. @@ -1890,7 +1890,7 @@ class OutputPage extends ContextSource { $text = $parserOutput->getText(); // Avoid PHP 7.1 warning of passing $this by reference $outputPage = $this; - Hooks::run( 'OutputPageBeforeHTML', [ &$outputPage, &$text ] ); + Hooks::runWithoutAbort( 'OutputPageBeforeHTML', [ &$outputPage, &$text ] ); $this->addHTML( $text ); } @@ -2200,7 +2200,7 @@ class OutputPage extends ContextSource { // IE and some other browsers use BCP 47 standards in // their Accept-Language header, like "zh-CN" or "zh-Hant". // We should handle these too. - $variantBCP47 = wfBCP47( $variant ); + $variantBCP47 = LanguageCode::bcp47( $variant ); if ( $variantBCP47 !== $variant ) { $aloption[] = 'substr=' . $variantBCP47; } @@ -2436,7 +2436,7 @@ class OutputPage extends ContextSource { $outputPage = $this; // Hook that allows last minute changes to the output page, e.g. // adding of CSS or Javascript by extensions. - Hooks::run( 'BeforePageDisplay', [ &$outputPage, &$sk ] ); + Hooks::runWithoutAbort( 'BeforePageDisplay', [ &$outputPage, &$sk ] ); try { $sk->outputPage(); @@ -2448,7 +2448,7 @@ class OutputPage extends ContextSource { try { // This hook allows last minute changes to final overall output by modifying output buffer - Hooks::run( 'AfterFinalPageOutput', [ $this ] ); + Hooks::runWithoutAbort( 'AfterFinalPageOutput', [ $this ] ); } catch ( Exception $e ) { ob_end_clean(); // bug T129657 throw $e; @@ -2923,15 +2923,14 @@ class OutputPage extends ContextSource { $pieces = array_merge( $pieces, array_values( $this->getHeadLinksArray() ) ); $pieces = array_merge( $pieces, array_values( $this->mHeadItems ) ); - $min = ResourceLoader::inDebugMode() ? '' : '.min'; // Use an IE conditional comment to serve the script only to old IE $pieces[] = ''; $pieces[] = Html::closeElement( 'head' ); @@ -3438,7 +3437,7 @@ class OutputPage extends ContextSource { foreach ( $variants as $variant ) { $tags["variant-$variant"] = Html::element( 'link', [ 'rel' => 'alternate', - 'hreflang' => wfBCP47( $variant ), + 'hreflang' => LanguageCode::bcp47( $variant ), 'href' => $this->getTitle()->getLocalURL( [ 'variant' => $variant ] ) ]