X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialFewestrevisions.php;h=7e4bc9cee307a49f4b1cad15feae541b1e0b91ef;hb=a36d5d29a183ae1c824888351dffba132f67d86d;hp=454e72cf02cd9b49d17cf25600a4127b675ba66d;hpb=39a2d2d42c9c0332a7acf8df32fbad18be9bd135;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialFewestrevisions.php b/includes/specials/SpecialFewestrevisions.php index 454e72cf02..7e4bc9cee3 100644 --- a/includes/specials/SpecialFewestrevisions.php +++ b/includes/specials/SpecialFewestrevisions.php @@ -44,10 +44,10 @@ class FewestrevisionsPage extends QueryPage { function getQueryInfo() { return array ( 'tables' => array ( 'revision', 'page' ), - 'fields' => array ( 'page_namespace AS namespace', - 'page_title AS title', - 'COUNT(*) AS value', - 'page_is_redirect AS redirect' ), + 'fields' => array ( 'namespace' => 'page_namespace', + 'title' => 'page_title', + 'value' => 'COUNT(*)', + 'redirect' => 'page_is_redirect' ), 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces(), 'page_id = rev_page' ), 'options' => array ( 'HAVING' => 'COUNT(*) > 1', @@ -56,7 +56,7 @@ class FewestrevisionsPage extends QueryPage { // useful to remove this. People _do_ create pages // and never revise them, they aren't necessarily // redirects. - 'GROUP BY' => 'page_namespace, page_title, page_is_redirect' ) + 'GROUP BY' => array( 'page_namespace', 'page_title', 'page_is_redirect' ) ) ); } @@ -68,32 +68,30 @@ class FewestrevisionsPage extends QueryPage { /** * @param $skin Skin object * @param $result Object: database row + * @return String */ function formatResult( $skin, $result ) { - global $wgLang, $wgContLang; + global $wgContLang; $nt = Title::makeTitleSafe( $result->namespace, $result->title ); if( !$nt ) { - return ''; + return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), + Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); } - $text = $wgContLang->convert( $nt->getPrefixedText() ); + $text = htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ); + $plink = Linker::linkKnown( $nt, $text ); - $plink = $skin->linkKnown( - $nt, - $text - ); - - $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ), - $wgLang->formatNum( $result->value ) ); - $redirect = isset($result->redirect) ? ' - ' . wfMsgHtml( 'isredirect' ) : ''; - $nlink = $skin->linkKnown( + $nl = $this->msg( 'nrevisions' )->numParams( $result->value )->escaped(); + $redirect = isset( $result->redirect ) && $result->redirect ? + ' - ' . $this->msg( 'isredirect' )->escaped() : ''; + $nlink = Linker::linkKnown( $nt, $nl, array(), array( 'action' => 'history' ) ) . $redirect; - return wfSpecialList( $plink, $nlink ); + return $this->getLanguage()->specialList( $plink, $nlink ); } }