From deb966096a1563c303d7a981fbfd410b770934b2 Mon Sep 17 00:00:00 2001 From: Samuel Vanhove Date: Mon, 27 Nov 2017 16:22:38 -0500 Subject: [PATCH 1/2] CRM-21470 Ensure we don't have an empty locale --- CRM/Utils/System/WordPress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 14cef9ef511f..03528c469c8c 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -391,7 +391,7 @@ public function getUFLocale() { // TODO: set language variable for others WordPress plugin - if (isset($language)) { + if (isset($language) && !empty($language)) { return CRM_Core_I18n_PseudoConstant::longForShort(substr($language, 0, 2)); } else { From 5a44748c7ca79b9d7152f8b3110091ed4887091f Mon Sep 17 00:00:00 2001 From: Samuel Vanhove Date: Mon, 27 Nov 2017 16:33:57 -0500 Subject: [PATCH 2/2] CRM-21470 Ensure we don't have an empty locale #2 --- CRM/Utils/System/WordPress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 03528c469c8c..ce6c322a5e24 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -391,7 +391,7 @@ public function getUFLocale() { // TODO: set language variable for others WordPress plugin - if (isset($language) && !empty($language)) { + if (!empty($language)) { return CRM_Core_I18n_PseudoConstant::longForShort(substr($language, 0, 2)); } else {