From 2f8a5b34e6a859f5df05500623ce93f0e868920e Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 23 May 2013 19:05:13 +0200 Subject: [PATCH] Add ss_active_users in SiteStats::isSane Also changed the array to the full row name, avoids unnecessary string concat Change-Id: Id8f1cb7035ae0058fb34a6c7bdf7bf9f6c740a69 --- includes/SiteStats.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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; } } -- 2.20.1