dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43b0367
)
Throw exception on wrong type in Language::isValidCode( $code )
author
Fomafix
<fomafix@googlemail.com>
Wed, 27 Jun 2018 10:16:26 +0000
(12:16 +0200)
committer
Fomafix
<fomafix@googlemail.com>
Tue, 12 Mar 2019 15:40:31 +0000
(16:40 +0100)
This prevents that Language::isValidCode( null ) returns true.
Depends-On: I38d8358469903afb15331212206635283cedcd46
Change-Id: I5dc5bd45d648a548dfd27aaa1b3c29a2e99f0e8b
languages/Language.php
patch
|
blob
|
history
diff --git
a/languages/Language.php
b/languages/Language.php
index
5ac2882
..
aaaf2a2
100644
(file)
--- a/
languages/Language.php
+++ b/
languages/Language.php
@@
-386,6
+386,7
@@
class Language {
*/
public static function isValidCode( $code ) {
static $cache = [];
+ Assert::parameterType( 'string', $code, '$code' );
if ( !isset( $cache[$code] ) ) {
// People think language codes are html safe, so enforce it.
// Ideally we should only allow a-zA-Z0-9-