From aaee1758c39f1a994fee4d51fcf9bf7d82d16386 Mon Sep 17 00:00:00 2001 From: Peter Edmond Date: Fri, 13 Jun 2025 21:28:34 +0100 Subject: [PATCH] Added default values for IP addresses to avoid errors --- getData.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/getData.php b/getData.php index 68b0cf2..66ecc92 100644 --- a/getData.php +++ b/getData.php @@ -124,15 +124,15 @@ if (isset($data['responses']) && is_array($data['responses'])) { 'startDate' => $startDateFormatted, 'endDate' => $endDateFormatted, 'status' => $response['values']['status'], - 'ipAddress' => $response['values']['ipAddress'], + 'ipAddress' => $response['values']['ipAddress'] ?? '0.0.0.0', 'progress' => $response['values']['progress'], 'duration' => $response['values']['duration'], 'finished' => $response['values']['finished'], 'recordedDate' => $recordedDateFormatted, - 'locationLatitude' => $response['values']['locationLatitude'], - 'locationLongitude' => $response['values']['locationLongitude'], + 'locationLatitude' => $response['values']['locationLatitude'] ?? '0.0', + 'locationLongitude' => $response['values']['locationLongitude'] ?? '0.0', 'distributionChannel' => $response['values']['distributionChannel'], - 'userLanguage' => $response['values']['userLanguage'] + 'userLanguage' => $response['values']['userLanguage'] ?? 'en' ];