From: Gilles Dubuc Date: Tue, 2 May 2017 12:58:06 +0000 (+0200) Subject: Toggle logo preloading via the skin X-Git-Tag: 1.31.0-rc.0~3368^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=13ffd04c5f4c7dde668bfb1312bf829934a912dd;p=lhc%2Fweb%2Fwiklou.git Toggle logo preloading via the skin Bug: T100999 Change-Id: I0e18dc7fdbf133f3e4002f48f3040604687571dc --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 5c05ad75d0..85610b9a5b 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2388,7 +2388,14 @@ class OutputPage extends ContextSource { // jQuery etc. can work correctly. $response->header( 'X-UA-Compatible: IE=Edge' ); - $this->addLogoPreloadLinkHeaders(); + if ( !$this->mArticleBodyOnly ) { + $sk = $this->getSkin(); + + if ( $sk->shouldPreloadLogo() ) { + $this->addLogoPreloadLinkHeaders(); + } + } + $linkHeader = $this->getLinkHeader(); if ( $linkHeader ) { $response->header( $linkHeader ); diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 99658f294a..7f00767e07 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -444,6 +444,15 @@ abstract class Skin extends ContextSource { return $wgLogo; } + /** + * Whether the logo should be preloaded with an HTTP link header or not + * @since 1.29 + * @return bool + */ + public function shouldPreloadLogo() { + return false; + } + /** * @return string HTML */