From 60ddb9e1bf9a23de5cf9baa7556d0cb058c1e8e5 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sun, 14 Dec 2025 16:47:25 -0700 Subject: [PATCH] Update USPS tracking library --- lib/Tracking_FedEx.lib.php | 2 +- lib/Tracking_USPS.lib.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Tracking_FedEx.lib.php b/lib/Tracking_FedEx.lib.php index efbdde3..1d66a9b 100644 --- a/lib/Tracking_FedEx.lib.php +++ b/lib/Tracking_FedEx.lib.php @@ -106,7 +106,7 @@ class Tracking_FedEx { } catch (Exception $ex) { throw new TrackingException("There was a server problem. This code cannot be tracked right now."); } - + $info = new TrackingInfo(); $info->setCode($trackinfo["trackingNumberInfo"]["trackingNumber"]); diff --git a/lib/Tracking_USPS.lib.php b/lib/Tracking_USPS.lib.php index 548be60..1f21073 100644 --- a/lib/Tracking_USPS.lib.php +++ b/lib/Tracking_USPS.lib.php @@ -121,9 +121,9 @@ class Tracking_USPS { $info->setFrom($from); $to = new Location(); - $to->city = (string) $trackinfo["destinationCity"] ?? ""; - $to->state = (string) $trackinfo["destinationState"] ?? ""; - $to->zip = (string) $trackinfo["destinationZIP"] ?? ""; + $to->city = (string) (isset($trackinfo["destinationCity"]) ? ($trackinfo["destinationCity"] ?? "") : ""); + $to->state = (string) (isset($trackinfo["destinationState"]) ? ($trackinfo["destinationState"] ?? "") : ""); + $to->zip = (string) (isset($trackinfo["destinationZIP"]) ? ($trackinfo["destinationZIP"] ?? "") : ""); $to->country = (string) (isset($trackinfo["destinationCountry"]) ? $trackinfo["destinationCountry"] : ""); $info->setTo($to);