From 50089b2c9acfdfad9bb424fb2dfccd4b69ba2638 Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:33:58 +0100 Subject: [PATCH] Add some robustness to get_server_lang --- bmlt-meeting-list.php | 7 +++---- readme.txt | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bmlt-meeting-list.php b/bmlt-meeting-list.php index b5f6ec5..9fc50a5 100644 --- a/bmlt-meeting-list.php +++ b/bmlt-meeting-list.php @@ -5,7 +5,7 @@ Description: Maintains and generates a PDF Meeting List from BMLT. Author: bmlt-enabled Author URI: https://bmlt.app -Version: 2.7.14 +Version: 2.7.15 */ /* Disallow direct access to the plugin file */ use Mpdf\Mpdf; @@ -456,9 +456,8 @@ function get_areas() function get_bmlt_server_lang() { - $results = $this->get_configured_root_server_request("client_interface/json/?switcher=GetServerInfo"); - $result = json_decode(wp_remote_retrieve_body($results), true); - if ($result==null) { + $result = $this->testRootServer(); + if (!($result && is_array($result) && is_array($result["0"]))) { return 'en'; } $result = $result["0"]["nativeLang"]; diff --git a/readme.txt b/readme.txt index 15b8496..b249745 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: meeting list, bmlt, narcotics anonymous, na Requires PHP: 8.1 Requires at least: 6.2 Tested up to: 6.6.1 -Stable tag: 2.7.14 +Stable tag: 2.7.15 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html