From e5665531c1c3c3cc219f04023aaa7f9b002c7765 Mon Sep 17 00:00:00 2001 From: cyu Date: Mon, 31 Oct 2022 14:52:03 -0700 Subject: [PATCH] php8 compatibility, replace array_key_exists() on non-array. --- CRM/Utils/Address/USPS.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/Address/USPS.php b/CRM/Utils/Address/USPS.php index fc53a7a70f..68e04b0227 100644 --- a/CRM/Utils/Address/USPS.php +++ b/CRM/Utils/Address/USPS.php @@ -101,7 +101,7 @@ class CRM_Utils_Address_USPS { return FALSE; } - if (array_key_exists('Error', $xml->Address)) { + if (property_exists($xml->Address, 'Error')) { $session->setStatus(ts('Address not found in USPS database.')); return FALSE; } @@ -112,7 +112,7 @@ class CRM_Utils_Address_USPS { $values['postal_code'] = (string) $xml->Address->Zip5; $values['postal_code_suffix'] = (string) $xml->Address->Zip4; - if (array_key_exists('Address1', $xml->Address)) { + if (property_exists($xml->Address, 'Address1')) { $values['supplemental_address_1'] = (string) $xml->Address->Address1; } -- 2.25.1