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
This commit is contained in:
Daimona Eaytoy 2018-08-25 17:03:03 +02:00
parent 937252a74c
commit 934399de45

View file

@ -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 ) );