From df9f00218fe023ca7d16d0ddca3ea6ee0c8ec071 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Sat, 16 Apr 2022 11:45:38 -0400 Subject: [PATCH] all three images update that way now! thanks! --- scripts/overview.php | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/scripts/overview.php b/scripts/overview.php index cc2ced6..d84a7ac 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -65,7 +65,16 @@ $totalspeciestally = $result6->fetchArray(SQLITE3_ASSOC); if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isset($_GET['previous_detection_identifier'])) { if($_GET['previous_detection_identifier'] != $filename || $_GET['previous_detection_identifier'] == "undefined") { // check to make sure the image actually exists, sometimes it takes a minute to be created - $headers = @get_headers("http://".$_SERVER['HTTP_HOST'].$filename.".png"); + if (isset($_SERVER['HTTPS']) && + ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || + isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && + $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { + $protocol = 'https://'; + } + else { + $protocol = 'http://'; + } + $headers = @get_headers($protocol.$_SERVER['HTTP_HOST'].$filename.".png"); if(strpos($headers[0],'200')) { ?>