It helps when you don't break things...
[lhc/web/wiklou.git] / includes / SpecialMostcategories.php
index e761942..589b96e 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 /**
+ * implements Special:Mostcategories
  * @addtogroup SpecialPage
  */
 class MostcategoriesPage extends QueryPage {
@@ -37,6 +38,7 @@ class MostcategoriesPage extends QueryPage {
        function formatResult( $skin, $result ) {
                global $wgLang;
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
+               if ( !$title instanceof Title ) { throw new MWException('Invalid title in database'); }
                $count = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value ) );
                $link = $skin->makeKnownLinkObj( $title, $title->getText() );
                return wfSpecialList( $link, $count );
@@ -54,4 +56,4 @@ function wfSpecialMostcategories() {
        $wpp->doQuery( $offset, $limit );
 }
 
-?>
+