Skip to content

Commit

Permalink
Update docker/ui.php
Browse files Browse the repository at this point in the history
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
  • Loading branch information
1 parent fe85a80 commit 0274f6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker/ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ function I(i){return document.getElementById(i);}
if($mode=="standalone" || $mode=="backend"){ ?>
var SPEEDTEST_SERVERS=[];
<?php } elseif ($mode=="dual") {
$servers = json_decode(file_get_contents('/servers.json'), true);
$jsonContent = @file_get_contents('/servers.json');
if ($jsonContent === false) {
$servers = [];
} else {
$servers = json_decode($jsonContent, true) ?: [];
}

// find out my own URL
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
Expand Down

0 comments on commit 0274f6e

Please sign in to comment.