From: umherirrender Date: Thu, 23 May 2013 17:05:13 +0000 (+0200) Subject: Add ss_active_users in SiteStats::isSane X-Git-Tag: 1.31.0-rc.0~19598^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=2f8a5b34e6a859f5df05500623ce93f0e868920e;p=lhc%2Fweb%2Fwiklou.git Add ss_active_users in SiteStats::isSane Also changed the array to the full row name, avoids unnecessary string concat Change-Id: Id8f1cb7035ae0058fb34a6c7bdf7bf9f6c740a69 --- diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 02e1911d6d..199c64fa9b 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -226,20 +226,24 @@ class SiteStats { * @return bool */ private static function isSane( $row ) { - if ( - $row === false + if ( $row === false || $row->ss_total_pages < $row->ss_good_articles || $row->ss_total_edits < $row->ss_total_pages + || $row->ss_users < $row->ss_active_users ) { return false; } // Now check for underflow/overflow - foreach ( array( 'total_views', 'total_edits', 'good_articles', - 'total_pages', 'users', 'images' ) as $member ) { - if ( - $row->{"ss_$member"} > 2000000000 - || $row->{"ss_$member"} < 0 - ) { + foreach ( array( + 'ss_total_views', + 'ss_total_edits', + 'ss_good_articles', + 'ss_total_pages', + 'ss_users', + 'ss_active_users', + 'ss_images', + ) as $member ) { + if ( $row->$member > 2000000000 || $row->$member < 0 ) { return false; } }