Merge "xhprof: Guard against division by 0 when computing percentages"
[lhc/web/wiklou.git] / includes / specials / SpecialShortpages.php
index e08aa8c..7ec69e0 100644 (file)
@@ -38,15 +38,18 @@ class ShortPagesPage extends QueryPage {
        }
 
        function getQueryInfo() {
-               return array (
-                       'tables' => array ( 'page' ),
-                       'fields' => array ( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'page_len' ),
-                       'conds' => array ( 'page_namespace' =>
-                                       MWNamespace::getContentNamespaces(),
-                                       'page_is_redirect' => 0 ),
-                       'options' => array ( 'USE INDEX' => 'page_redirect_namespace_len' )
+               return array(
+                       'tables' => array( 'page' ),
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'page_len'
+                       ),
+                       'conds' => array(
+                               'page_namespace' => MWNamespace::getContentNamespaces(),
+                               'page_is_redirect' => 0
+                       ),
+                       'options' => array( 'USE INDEX' => 'page_redirect_namespace_len' )
                );
        }
 
@@ -55,7 +58,7 @@ class ShortPagesPage extends QueryPage {
        }
 
        /**
-        * @param $db DatabaseBase
+        * @param IDatabase $db
         * @param ResultWrapper $res
         */
        function preprocessResults( $db, $res ) {
@@ -111,8 +114,8 @@ class ShortPagesPage extends QueryPage {
                $size = $this->msg( 'nbytes' )->numParams( $result->value )->escaped();
 
                return $exists
-                               ? "${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"
-                               : "<del>${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>";
+                       ? "${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"
+                       : "<del>${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>";
        }
 
        protected function getGroupName() {