From 934399de45fb71130c7b238fe1731f96a114ac95 Mon Sep 17 00:00:00 2001 From: Daimona Eaytoy Date: Sat, 25 Aug 2018 17:03:03 +0200 Subject: [PATCH] Remove _age variables from cache keys As we do for user_age, since these will always change. Also, rework the method to avoid repetition of unset(). Change-Id: Ie5ceedd89cae3813bacf6680d588bc925362c2c2 --- includes/AbuseFilter.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/includes/AbuseFilter.php b/includes/AbuseFilter.php index 878a9ff91..78a4a4e04 100644 --- a/includes/AbuseFilter.php +++ b/includes/AbuseFilter.php @@ -1270,10 +1270,17 @@ class AbuseFilter { ) { $inputVars = $vars->exportNonLazyVars(); // Exclude noisy fields that have superficial changes - unset( $inputVars['old_html'] ); - unset( $inputVars['new_html'] ); - unset( $inputVars['user_age'] ); - unset( $inputVars['timestamp'] ); + $excludedVars = [ + 'old_html' => true, + 'new_html' => true, + 'user_age' => true, + 'timestamp' => true, + 'page_age' => true, + 'moved_from_age' => true, + 'moved_to_age' => true + ]; + + $inputVars = array_diff_key( $inputVars, $excludedVars ); ksort( $inputVars ); $hash = md5( serialize( $inputVars ) );