From bf4ffe47cda08816a814079d41993b9fdd6d1bf4 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 11 Apr 2023 23:19:32 +0200 Subject: [PATCH] Check for valid downloaded LotW status report and report errors appropriately --- application/controllers/Lotw.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 97403b150..e5be23f0a 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -650,6 +650,9 @@ class Lotw extends CI_Controller { return "Temporary download directory ".dirname($file)." is not writable. Aborting!"; } file_put_contents($file, file_get_contents($lotw_url)); + if (file_get_contents($file, false, null, 0, 39) != "ARRL Logbook of the World Status Report") { + return "LotW downloading failed either due to it being down or incorrect logins."; + } ini_set('memory_limit', '-1'); $results = $this->loadFromFile($file, false);