X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMediaStatistics.php;h=e5ba8c60b5420e9968cda2d5ea32c22decf0d0fd;hb=b9fbbba4af3e56b504240fc32d1c9199f4444212;hp=1056cdaea71a3d230c1b2c476de3759af7e5ddc6;hpb=8e40929e096123170835f10aae5e69e4546f5a2f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMediaStatistics.php b/includes/specials/SpecialMediaStatistics.php index 1056cdaea7..e5ba8c60b5 100644 --- a/includes/specials/SpecialMediaStatistics.php +++ b/includes/specials/SpecialMediaStatistics.php @@ -36,7 +36,7 @@ class MediaStatisticsPage extends QueryPage { $this->shownavigation = false; } - function isExpensive() { + public function isExpensive() { return true; } @@ -73,6 +73,10 @@ class MediaStatisticsPage extends QueryPage { 'namespace' => NS_MEDIA, /* needs to be something */ 'value' => '1' ), + 'conds' => array( + // WMF has a random null row in the db + 'img_media_type IS NOT NULL' + ), 'options' => array( 'GROUP BY' => array( 'img_media_type', @@ -107,7 +111,11 @@ class MediaStatisticsPage extends QueryPage { protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) { $prevMediaType = null; foreach ( $res as $row ) { - list( $mediaType, $mime, $totalCount, $totalBytes ) = $this->splitFakeTitle( $row->title ); + $mediaStats = $this->splitFakeTitle( $row->title ); + if ( count( $mediaStats ) < 4 ) { + continue; + } + list( $mediaType, $mime, $totalCount, $totalBytes ) = $mediaStats; if ( $prevMediaType !== $mediaType ) { if ( $prevMediaType !== null ) { // We're not at beginning, so we have to @@ -228,7 +236,7 @@ class MediaStatisticsPage extends QueryPage { 'mw-mediastats-table-' . strtolower( $mediaType ), 'sortable', 'wikitable' - )) + ) ) ) ); $this->getOutput()->addHTML( $this->getTableHeaderRow() ); @@ -267,7 +275,7 @@ class MediaStatisticsPage extends QueryPage { array( 'class' => array( 'mw-mediastats-mediatype', 'mw-mediastats-mediatype-' . strtolower( $mediaType ) - )), + ) ), // for grep // mediastatistics-header-unknown, mediastatistics-header-bitmap, // mediastatistics-header-drawing, mediastatistics-header-audio,