X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Fdeferred%2FSiteStatsUpdate.php;h=7cb2950942cb16d8c0acd603df89bd4794fd94cb;hb=709b4156823721040bd782e4ad1ac7a7d8c0dc6e;hp=79aab7d099dbb4c1f5b8094f734b99e2b1708e62;hpb=27c61fb1e94da9114314468fd00bcf129ec064b6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/SiteStatsUpdate.php b/includes/deferred/SiteStatsUpdate.php index 79aab7d099..7cb2950942 100644 --- a/includes/deferred/SiteStatsUpdate.php +++ b/includes/deferred/SiteStatsUpdate.php @@ -66,6 +66,12 @@ class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate { public static function factory( array $deltas ) { $update = new self( 0, 0, 0 ); + foreach ( $deltas as $name => $unused ) { + if ( !in_array( $name, self::$counters ) ) { // T187585 + throw new UnexpectedValueException( __METHOD__ . ": no field called '$name'" ); + } + } + foreach ( self::$counters as $field ) { if ( isset( $deltas[$field] ) && $deltas[$field] ) { $update->$field = $deltas[$field];