From 521b15835c6f62f1c8dd2db18c4d627756ef51c6 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Fri, 17 Feb 2023 00:24:24 -0700 Subject: [PATCH] Remove carrier formatting cruft from tracking details --- lib/TrackingEntry.lib.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/TrackingEntry.lib.php b/lib/TrackingEntry.lib.php index 5d73039..b98bcba 100644 --- a/lib/TrackingEntry.lib.php +++ b/lib/TrackingEntry.lib.php @@ -18,6 +18,20 @@ class TrackingEntry { $this->location = $location; } $this->iscontainerscan = $iscontainerscan; + $this->formatDetails(); + } + + /** + * Do some find/replace on the event details to clean up some carrier formatting nonsense. + */ + private function formatDetails() { + $findreplace = [ + "®" => "®" + ]; + + foreach ($findreplace as $f => $r) { + $this->details = str_replace($f, $r, $this->details); + } } public function toString(): string {