From 144d9e62ecf555a979c40e4f5c453cbf2d646242 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 6 Dec 2014 13:34:12 +0100 Subject: [PATCH] Ensure integer compare in Special:WantedCategories For some reasons the qc_value from the query is returned as string, not integer. The strict unequal comparision gives always true and that results in unwanted "1 -> 1 member". Added a intval call. Bug: T76910 Change-Id: I26e2718e418f35e2e10565c747a8f06f2bbb5ba3 --- includes/specials/SpecialWantedcategories.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialWantedcategories.php b/includes/specials/SpecialWantedcategories.php index b8c0bb2820..7ddafae40e 100644 --- a/includes/specials/SpecialWantedcategories.php +++ b/includes/specials/SpecialWantedcategories.php @@ -109,6 +109,7 @@ class WantedCategoriesPage extends WantedQueryPage { $currentValue = isset( $this->currentCategoryCounts[$result->title] ) ? $this->currentCategoryCounts[$result->title] : 0; + $cachedValue = intval( $result->value ); // T76910 // If the category has been created or emptied since the list was refreshed, strike it if ( $nt->isKnown() || $currentValue === 0 ) { @@ -116,11 +117,11 @@ class WantedCategoriesPage extends WantedQueryPage { } // Show the current number of category entries if it changed - if ( $currentValue !== $result->value ) { + if ( $currentValue !== $cachedValue ) { $nlinks = $this->msg( 'nmemberschanged' ) - ->numParams( $result->value, $currentValue )->escaped(); + ->numParams( $cachedValue, $currentValue )->escaped(); } else { - $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped(); + $nlinks = $this->msg( 'nmembers' )->numParams( $cachedValue )->escaped(); } } -- 2.20.1