X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FSiteStatsUpdate.php;h=7cb2950942cb16d8c0acd603df89bd4794fd94cb;hb=e95a6a6b59cb412b9682608899147209238e8248;hp=79aab7d099dbb4c1f5b8094f734b99e2b1708e62;hpb=4b2f95bed5a9ae0a917264abed2ba1fd9fb78f3c;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];