From 3cac324d99c1dcc5a528975eda56cd5b6d31146b Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 3 Jan 2026 22:03:41 +0100 Subject: [PATCH 1/2] Catch LoTW download rate limit and log accordingly --- application/controllers/Lotw.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 748ca5d70..a9aafeed7 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -775,6 +775,10 @@ class Lotw extends CI_Controller { log_message('error', 'Deleting LoTW credentials for user '.$user->user_name.' failed'); } continue; + } else if (str_contains($content,"Page Request Limit!")) { + $result = "LoTW download hit a rate limit for user ".$user->user_lotw_name; + log_message('error', 'LoTW download hit a rate limit for user '.$user->user_name); + continue; } file_put_contents($file, $content); if (file_get_contents($file, false, null, 0, 39) != "ARRL Logbook of the World Status Report") { From f3dc790f92c18551cb71c8f1a82998615a40fc26 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 4 Jan 2026 08:29:21 +0100 Subject: [PATCH 2/2] Put limit to string extraction --- application/controllers/Lotw.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index a9aafeed7..866981634 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -766,7 +766,7 @@ class Lotw extends CI_Controller { break; } continue; - } else if(str_contains($content,"Username/password incorrect")) { + } else if(str_contains(substr($content,0 , 2000),"Username/password incorrect")) { $result = "LoTW download failed for user ".$user->user_lotw_name.": Username/password incorrect"; log_message('error', 'LoTW download failed for user '.$user->user_name.': Username/password incorrect'); if ($this->Lotw_model->remove_lotw_credentials($user->user_id)) { @@ -775,7 +775,7 @@ class Lotw extends CI_Controller { log_message('error', 'Deleting LoTW credentials for user '.$user->user_name.' failed'); } continue; - } else if (str_contains($content,"Page Request Limit!")) { + } else if (str_contains(substr($content, 0, 2000),"Page Request Limit!")) { $result = "LoTW download hit a rate limit for user ".$user->user_lotw_name; log_message('error', 'LoTW download hit a rate limit for user '.$user->user_name); continue;