Fixed bug ErrorException

Fixed bug where a timeout in the update server response would throw an Error Exception
This commit is contained in:
Julian Prieber 2022-02-23 20:53:50 +01:00 committed by GitHub
parent 4e78b1a58f
commit bbc0e8e86e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -130,6 +130,7 @@
<! #### begin update detection #### > <! #### begin update detection #### >
<?php // Checks if URL exists <?php // Checks if URL exists
try {
function URL_exists(string $url): bool function URL_exists(string $url): bool
{ {
return str_contains(get_headers($url)[0], "200 OK"); return str_contains(get_headers($url)[0], "200 OK");
@ -137,7 +138,8 @@
// Sets $ServerExists to true if URL exists // Sets $ServerExists to true if URL exists
if (URL_exists("https://littlelink-custom.tru.io/version.json")){ if (URL_exists("https://littlelink-custom.tru.io/version.json")){
$ServerExists = "true"; $ServerExists = "true";
} else { }
} catch (exception $e) {
$ServerExists = "false"; $ServerExists = "false";
} }
?> ?>