Merge "(bug 47070) check content model namespace on import."
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index 811e35d..918fc9e 100644 (file)
@@ -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,
@@ -615,7 +619,7 @@ class InfoAction extends FormlessAction {
         * @return array
         */
        protected static function pageCounts( Title $title ) {
-               global $wgRCMaxAge, $wgDisableCounters;
+               global $wgRCMaxAge, $wgDisableCounters, $wgMiserMode;
 
                wfProfileIn( __METHOD__ );
                $id = $title->getArticleID();
@@ -719,15 +723,19 @@ class InfoAction extends FormlessAction {
                }
 
                // Counts for the number of transclusion links (to/from)
-               $result['transclusion']['to'] = (int)$dbr->selectField(
-                       'templatelinks',
-                       'COUNT(tl_from)',
-                       array(
-                               'tl_namespace' => $title->getNamespace(),
-                               'tl_title' => $title->getDBkey()
-                       ),
-                       __METHOD__
-               );
+               if ( $wgMiserMode ) {
+                       $result['transclusion']['to'] = 0;
+               } else {
+                       $result['transclusion']['to'] = (int)$dbr->selectField(
+                               'templatelinks',
+                               'COUNT(tl_from)',
+                               array(
+                                       'tl_namespace' => $title->getNamespace(),
+                                       'tl_title' => $title->getDBkey()
+                               ),
+                               __METHOD__
+                       );
+               }
 
                $result['transclusion']['from'] = (int)$dbr->selectField(
                        'templatelinks',