diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php index 54e6284f..862a9b79 100644 --- a/includes/FooterHooks.php +++ b/includes/FooterHooks.php @@ -34,19 +34,6 @@ class FooterHooks { return true; } - /** - * Uses the Disambiguator extension to test whether the page is a disambiguation page. - * - * If the Disambiguator extension isn't installed, then the test always fails, i.e. the page is - * never a disambiguation page. - * - * @return boolean - */ - private static function isDisambiguationPage( Title $title ) { - return class_exists( 'DisambiguatorHooks' ) && - DisambiguatorHooks::isDisambiguationPage( $title ); - } - /** * Handler for the BeforePageDisplay hook. * @@ -54,12 +41,12 @@ class FooterHooks { * to the output when: * *
    + *
  1. The page is not a disambiguation page
  2. *
  3. $wgRelatedArticlesShowInFooter is truthy
  4. *
  5. On mobile, the output is being rendered with * SkinMinervaBeta
  6. *
  7. On desktop, the beta feature has been enabled
  8. *
  9. The page is in mainspace
  10. - *
  11. The page is not a disambiguation page
  12. *
* * @param OutputPage $out @@ -67,6 +54,10 @@ class FooterHooks { * @return boolean Always true */ public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) { + if ( class_exists( 'DisambiguatorHooks' ) && + DisambiguatorHooks::isDisambiguationPage( $out->getTitle() ) ) { + return true; + } $config = ConfigFactory::getDefaultInstance()->makeConfig( 'RelatedArticles' ); $showReadMore = $config->get( 'RelatedArticlesShowInFooter' ); @@ -75,8 +66,7 @@ class FooterHooks { if ( $showReadMore && $title->inNamespace( NS_MAIN ) && - !$title->isMainPage() && - !self::isDisambiguationPage( $title ) + !$title->isMainPage() ) { if ( get_class( $skin ) === 'SkinMinervaBeta' ||