From: umherirrender Date: Sat, 6 Dec 2014 12:34:12 +0000 (+0100) Subject: Ensure integer compare in Special:WantedCategories X-Git-Tag: 1.31.0-rc.0~12888^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=144d9e62ecf555a979c40e4f5c453cbf2d646242;p=lhc%2Fweb%2Fwiklou.git 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 --- 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(); } }