Skip to content

Commit

Permalink
Add some robustness to get_server_lang
Browse files Browse the repository at this point in the history
  • Loading branch information
otrok7 committed Nov 6, 2024
1 parent f39656e commit 50089b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions bmlt-meeting-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"];
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 50089b2

Please sign in to comment.