From 563dc2d3e04e2dc9459572d3aadad8781a09e102 Mon Sep 17 00:00:00 2001 From: William Tam Date: Thu, 27 Jun 2024 17:22:53 -0400 Subject: [PATCH] debug errorlogging --- classes/class-pbs-check-dma.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class-pbs-check-dma.php b/classes/class-pbs-check-dma.php index 9046c68..1390edf 100644 --- a/classes/class-pbs-check-dma.php +++ b/classes/class-pbs-check-dma.php @@ -77,14 +77,14 @@ public function get_location_from_ip($client_ip) { error_log("parse error"); return array('errors' => $response); } - $zipcode = $override_zipcode ? $override_zipcode : $zipcode; + $zipcode = $override_zipcode ? $override_zipcode : false; $state = ''; $county = ''; if (!$override_zipcode && (empty($item['$links']) || !is_array($item['$links']))) { error_log("links error"); return array('errors' => $response); } - if (isset($item['$links'])) { + if (is_array($item['$links'])) { foreach ($item['$links'] as $link) { if ($link['$relationship'] == "related") { $state = !empty($link['$items'][0]['$links'][0]['state']) ? $link['$items'][0]['$links'][0]['state'] : '';