From 777ddee3aa87896220a4d381493bf1973b89ed2a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 14 Oct 2018 03:52:55 +0100 Subject: [PATCH] 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 --- includes/api/ApiTemplateData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiTemplateData.php b/includes/api/ApiTemplateData.php index 319b3a59..33d22469 100644 --- a/includes/api/ApiTemplateData.php +++ b/includes/api/ApiTemplateData.php @@ -112,7 +112,7 @@ class ApiTemplateData extends ApiBase { ); } - if ( $langCode ) { + if ( $langCode !== false ) { $data = $tdb->getDataInLanguage( $langCode ); } else { $data = $tdb->getData();