From c571bfc8442db7809b55636842b286c426548204 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 5 Dec 2023 10:14:46 +0100 Subject: [PATCH] Fix endless running loop for b0rken ADIF tags --- application/libraries/Adif_parser.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/libraries/Adif_parser.php b/application/libraries/Adif_parser.php index 96f670ed..0a833d38 100644 --- a/application/libraries/Adif_parser.php +++ b/application/libraries/Adif_parser.php @@ -153,6 +153,10 @@ class ADIF_Parser { $tag_name = $tag_name.mb_substr($record, $a, 1, "UTF-8"); //append this char to the tag name $a++; + // Prevent iterating $a past record length + if ($a == mb_strlen($record, "UTF-8")) { + return; + } }; $a++; //iterate past the colon while(mb_substr($record, $a, 1, "UTF-8") != '>' && mb_substr($record, $a, 1, "UTF-8") != ':')