From: jenkins-bot Date: Thu, 7 May 2015 19:30:24 +0000 (+0000) Subject: Merge "Converted ChangeTags to using the WAN cache" X-Git-Tag: 1.31.0-rc.0~11468 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=e00d638bb1ac6db8087772038516c96405737f77;p=lhc%2Fweb%2Fwiklou.git Merge "Converted ChangeTags to using the WAN cache" --- e00d638bb1ac6db8087772038516c96405737f77 diff --cc includes/changetags/ChangeTags.php index a0c3cf2669,096fedc52d..64f89bf099 --- a/includes/changetags/ChangeTags.php +++ b/includes/changetags/ChangeTags.php @@@ -1217,25 -1222,8 +1223,26 @@@ class ChangeTags } // Cache for a very short time - $wgMemc->set( $key, $out, 300 ); + $cache->set( $key, $out, 300 ); + return $out; } + + /** + * Indicate whether change tag editing UI is relevant + * + * Returns true if the user has the necessary right and there are any + * editable tags defined. + * + * This intentionally doesn't check "any addable || any deletable", because + * it seems like it would be more confusing than useful if the checkboxes + * suddenly showed up because some abuse filter stopped defining a tag and + * then suddenly disappeared when someone deleted all uses of that tag. + * + * @param User $user + * @return bool + */ + public static function showTagEditingUI( User $user ) { + return $user->isAllowed( 'changetags' ) && (bool)self::listExplicitlyDefinedTags(); + } }