X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialShortpages.php;h=5d748c238f65523bc6af31245f9a56782a45c1ee;hb=fcd1cdeb930e1779af77b3747b7c60338d4e81d7;hp=c3eafc41187f026a411302c8cb0d310b2b962e6d;hpb=2af8995c5992b79fe37dc985eb3074ba60dce436;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialShortpages.php b/includes/SpecialShortpages.php index c3eafc4118..5d748c238f 100644 --- a/includes/SpecialShortpages.php +++ b/includes/SpecialShortpages.php @@ -1,43 +1,69 @@ tableName( 'page' ); + $name = $dbr->addQuotes( $this->getName() ); + return - "SELECT 'Shortpages' as type, - cur_namespace as namespace, - cur_title as title, - LENGTH(cur_text) AS value - FROM cur - WHERE cur_namespace=0 AND cur_is_redirect=0"; + "SELECT $name as type, + page_namespace as namespace, + page_title as title, + page_len AS value + FROM $page FORCE INDEX (page_len) + WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0"; } - + function sortDescending() { return false; } function formatResult( $skin, $result ) { - global $wgLang; - $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) ); - $link = $skin->makeKnownLink( $result->title, "" ); - return "{$link} ({$nb})"; + global $wgLang, $wgContLang; + $nb = htmlspecialchars( wfMsg( 'nbytes', $wgLang->formatNum( $result->value ) ) ); + $title = Title::makeTitle( $result->namespace, $result->title ); + $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); + $histlink = $skin->makeKnownLinkObj( $title, wfMsgHtml('hist'), 'action=history' ); + return "({$histlink}) $link ({$nb})"; } } +/** + * constructor + */ function wfSpecialShortpages() { list( $limit, $offset ) = wfCheckLimits();