jenkins-bot has submitted this change and it was merged.

Change subject: Code style fixes in Language::isValidCode()
......................................................................


Code style fixes in Language::isValidCode()

Fix issues from https://gerrit.wikimedia.org/r/#/c/62123

Change-Id: I97e826bb9aa9e3a14d07aab7cf02a09ef2c84ef7
---
M languages/Language.php
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  IAlex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/languages/Language.php b/languages/Language.php
index 84e7f37..2fd4bb7 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -327,18 +327,18 @@
         */
        public static function isValidCode( $code ) {
                static $cache = array();
-               if( isset( $cache[$code] ) ) {
+               if ( isset( $cache[$code] ) ) {
                        return $cache[$code];
                }
                // People think language codes are html safe, so enforce it.
                // Ideally we should only allow a-zA-Z0-9-
                // but, .+ and other chars are often used for {{int:}} hacks
                // see bugs 37564, 37587, 36938
-               $return =
+               $cache[$code] =
                        strcspn( $code, ":/\\\000&<>'\"" ) === strlen( $code )
                        && !preg_match( Title::getTitleInvalidRegex(), $code );
-               $cache[ $code ] = $return;
-               return $return;
+
+               return $cache[$code];
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/62170
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I97e826bb9aa9e3a14d07aab7cf02a09ef2c84ef7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Lwelling <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to