From 791d3597876e9191ffc8d7ee67cf99c1b870c5cc Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 22 May 2023 12:58:03 +0200 Subject: [PATCH] Make eQSL buld download fucntion backwards compatible --- application/controllers/Eqsl.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index e1e9507d..05d70fbf 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -565,7 +565,7 @@ class eqsl extends CI_Controller { $image_url = $this->electronicqsl->card_image($username, urlencode($password), $callsign, $band, $mode, $year, $month, $day, $hour, $minute); $file = file_get_contents($image_url, true); - if (str_contains($file, 'Error')) { + if (strpos($file, 'Error') !== false) { $error = rtrim(preg_replace('/^\s*Error: /', '', $file)); return $error; } @@ -639,7 +639,9 @@ class eqsl extends CI_Controller { } else { $i++; } - sleep(15); + if ($i > 0) { + sleep(15); + } } $data['eqsl_results'] = $eqsl_results; $data['eqsl_stats'] = "Successfully downloaded: ".$i." / Errors: ".count($eqsl_results);