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:
Timo Tijhof 2018-10-14 03:52:55 +01:00
parent 29162276eb
commit 777ddee3aa

View file

@ -112,7 +112,7 @@ class ApiTemplateData extends ApiBase {
);
}
if ( $langCode ) {
if ( $langCode !== false ) {
$data = $tdb->getDataInLanguage( $langCode );
} else {
$data = $tdb->getData();