X-Git-Url: https://git.heureux-cyclage.org/index.php?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMediaStatistics.php;h=8f14a41e4fcc076d7dae37e2d4c76f334f474850;hb=6aaddf00c3c4498fcf079f45c26aebe3a909e45c;hp=1056cdaea71a3d230c1b2c476de3759af7e5ddc6;hpb=3bc7459cc3b25a451b40f6f85531b40c163971fa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMediaStatistics.php b/includes/specials/SpecialMediaStatistics.php index 1056cdaea7..8f14a41e4f 100644 --- a/includes/specials/SpecialMediaStatistics.php +++ b/includes/specials/SpecialMediaStatistics.php @@ -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