From ba8c6db5ea9074c7de4d4de95616d66b5aed08de Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 16 Jan 2014 12:39:33 -0800 Subject: [PATCH] Avoid expensive backlink counts for info action in miser mode Change-Id: I13b64db1b23afd995cd0a2f5872fcedadd86c8ea --- includes/actions/InfoAction.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 811e35de65..a424b9db7a 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -193,7 +193,7 @@ class InfoAction extends FormlessAction { * @return array */ protected function pageInfo() { - global $wgContLang, $wgRCMaxAge, $wgMemc, + global $wgContLang, $wgRCMaxAge, $wgMemc, $wgMiserMode, $wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit; $user = $this->getUser(); @@ -540,7 +540,11 @@ class InfoAction extends FormlessAction { ) { $options = array( 'LIMIT' => $wgPageInfoTransclusionLimit ); $transcludedTemplates = $title->getTemplateLinksFrom( $options ); - $transcludedTargets = $title->getTemplateLinksTo( $options ); + if ( $wgMiserMode ) { + $transcludedTargets = array(); + } else { + $transcludedTargets = $title->getTemplateLinksTo( $options ); + } // Page properties $pageInfo['header-properties'] = array(); @@ -581,7 +585,7 @@ class InfoAction extends FormlessAction { ); } - if ( $pageCounts['transclusion']['to'] > 0 ) { + if ( !$wgMiserMode && $pageCounts['transclusion']['to'] > 0 ) { if ( $pageCounts['transclusion']['to'] > count( $transcludedTargets ) ) { $more = Linker::link( $whatLinksHere, -- 2.20.1