diff options
author | Ammarpad <ammarpad@yahoo.com> | 2021-03-18 11:59:00 +0100 |
---|---|---|
committer | Ammarpad <ammarpad@yahoo.com> | 2021-03-18 20:07:51 +0000 |
commit | f6cd743e78f91e7a0cb7af1757570cc8f031917c (patch) | |
tree | e25a49faa56cd99d70504a3b64c6b09abcb36881 /languages/classes/LanguageKk.php | |
parent | 2c0b32adb0d8a6e3c4b6a311a44b908b968a6e22 (diff) | |
download | mediawikicore-f6cd743e78f91e7a0cb7af1757570cc8f031917c.tar.gz mediawikicore-f6cd743e78f91e7a0cb7af1757570cc8f031917c.zip |
LanguageKk: Guard against passing empty string to {{grammar}}
Passing empty string as the second arg for "{{grammar}}" does not make
sense and short-circuiting this case saves several function calls.
Bug: T277689
Change-Id: Iefbc6d432488f18b1e68a311c1791a7ea7493f39
Diffstat (limited to 'languages/classes/LanguageKk.php')
-rw-r--r-- | languages/classes/LanguageKk.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/languages/classes/LanguageKk.php b/languages/classes/LanguageKk.php index 44149c3327f6..95c5cd4f57c0 100644 --- a/languages/classes/LanguageKk.php +++ b/languages/classes/LanguageKk.php @@ -68,6 +68,11 @@ class LanguageKk extends LanguageKk_cyrl { * @return string */ public function convertGrammar( $word, $case ) { + // T277689: If there's no word, then there's nothing to convert. + if ( $word === '' ) { + return ''; + } + $variant = $this->getPreferredVariant(); switch ( $variant ) { case 'kk-arab': |