X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialDeadendpages.php;h=2a967c588fdfa4b939321385f200f11b3436b3a4;hb=c00c34f288c13b5360e30c694d929e4c65e3a3a1;hp=6978d6bb96c6388afa48daa776f24913ca714d15;hpb=99e968b5aa933a33a45216f6355f00780a0cf203;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialDeadendpages.php b/includes/specials/SpecialDeadendpages.php index 6978d6bb96..2a967c588f 100644 --- a/includes/specials/SpecialDeadendpages.php +++ b/includes/specials/SpecialDeadendpages.php @@ -21,6 +21,8 @@ * @ingroup SpecialPage */ +use MediaWiki\MediaWikiServices; + /** * A special page that list pages that contain no link to other pages * @@ -57,29 +59,37 @@ class DeadendPagesPage extends PageQueryPage { } function getQueryInfo() { - return array( - 'tables' => array( 'page', 'pagelinks' ), - 'fields' => array( 'namespace' => 'page_namespace', - 'title' => 'page_title', - 'value' => 'page_title' - ), - 'conds' => array( 'pl_from IS NULL', - 'page_namespace' => MWNamespace::getContentNamespaces(), - 'page_is_redirect' => 0 - ), - 'join_conds' => array( 'pagelinks' => array( 'LEFT JOIN', array( - 'page_id=pl_from' - ) ) ) - ); + return [ + 'tables' => [ 'page', 'pagelinks' ], + 'fields' => [ + 'namespace' => 'page_namespace', + 'title' => 'page_title', + 'value' => 'page_title' + ], + 'conds' => [ + 'pl_from IS NULL', + 'page_namespace' => MediaWikiServices::getInstance()->getNamespaceInfo()-> + getContentNamespaces(), + 'page_is_redirect' => 0 + ], + 'join_conds' => [ + 'pagelinks' => [ + 'LEFT JOIN', + [ 'page_id=pl_from' ] + ] + ] + ]; } function getOrderFields() { // For some crazy reason ordering by a constant // causes a filesort - if( count( MWNamespace::getContentNamespaces() ) > 1 ) { - return array( 'page_namespace', 'page_title' ); + if ( count( MediaWikiServices::getInstance()->getNamespaceInfo()-> + getContentNamespaces() ) > 1 + ) { + return [ 'page_namespace', 'page_title' ]; } else { - return array( 'page_title' ); + return [ 'page_title' ]; } }