From 0b255207b7b51ca77379281c061b6f02086fa1f9 Mon Sep 17 00:00:00 2001 From: mdPlusPlus Date: Sun, 8 Jan 2023 20:37:10 +0100 Subject: [PATCH] Assume $preview_link if empty for some reason --- get_online_session_communities.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/get_online_session_communities.php b/get_online_session_communities.php index 1677239..4136b71 100644 --- a/get_online_session_communities.php +++ b/get_online_session_communities.php @@ -583,7 +583,9 @@ $result = $preview_link; if(!url_is_200($preview_link)) { if(!url_is_200($preview_link_alt)) { - $result = null; // $preview_link and $preview_link_alt not reachable + // $preview_link and $preview_link_alt not reachable + //$result = null; + $result = $preview_link; // assume preview_link to be the valid one TODO: Why is it empty sometimes? } else { $result = $preview_link_alt; // $preview_link_alt reachable @@ -647,13 +649,15 @@ $identifier = $room_array["token"] . "+" . $shortened_pubkey; $preview_link = get_preview_link($server_url, $room_array["token"]); - // debug logging + // debug logging - does not work anymore, since $preview_link will not be empty when failed + /* if(!$preview_link || $preview_link == "") { echo("Preview link is empty. Dumping variables." . PHP_EOL); echo("Join link: " . $join_link . PHP_EOL); echo("Server: " . $server_url. PHP_EOL); echo("Token: " . $room_array["token"] . PHP_EOL); } + */ $info_array = array( "name" => $room_array["name"],