mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-15 03:34:44 +00:00
ApiTemplateData: Use strict check for $langCode
This is assigned as boolean false or any string value. The previous code used in implicit boolean cast to differentiate, but the check is insufficient given that "" and "0" would also cast to false. It is not the responsibility of this code to filter those out. Change-Id: I2cc707432b93703b29c49ac17d737f34119fc400
This commit is contained in:
parent
29162276eb
commit
777ddee3aa
|
@ -112,7 +112,7 @@ class ApiTemplateData extends ApiBase {
|
|||
);
|
||||
}
|
||||
|
||||
if ( $langCode ) {
|
||||
if ( $langCode !== false ) {
|
||||
$data = $tdb->getDataInLanguage( $langCode );
|
||||
} else {
|
||||
$data = $tdb->getData();
|
||||
|
|
Loading…
Reference in a new issue