From 131d69e8fbbc80e832c4f5f1064838655d34d68b Mon Sep 17 00:00:00 2001 From: polyte pablo Date: Tue, 10 Dec 2019 15:37:18 +0100 Subject: [PATCH] parameter type change from string to integer for PHP 7.1+ --- psgdpr.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/psgdpr.php b/psgdpr.php index 86c26524..90675ce8 100755 --- a/psgdpr.php +++ b/psgdpr.php @@ -781,11 +781,17 @@ public function getCustomerDataFromPrestashop($customer) $messageList = CustomerThread::getCustomerMessages($customer->id); if (count($messageList) >= 1) { + if (version_compare(PHP_VERSION, '7.1', '>=') >= 0) { + $ipAddressAsInt = true; + } else { + $ipAddressAsInt = false; + } foreach ($messageList as $index => $message) { + $id_address = ($ipAddressAsInt) ? (int)$message['ip_address'] : $message['ip_address']; array_push($messages, array( 'id_customer_thread' => $message['id_customer_thread'], 'message' => $message['message'], - 'ip' => long2ip($message['ip_address']), + 'ip' => long2ip($id_address), 'date_add' => $message['date_add'], )); }