diff --git a/lib/Carriers.lib.php b/lib/Carriers.lib.php index 47ef134..f91fc6d 100644 --- a/lib/Carriers.lib.php +++ b/lib/Carriers.lib.php @@ -49,7 +49,7 @@ class Carriers { ], [ "carrier" => "usps", - "pattern" => "/^\\x1D420[0-9]{5,11}\\x1D[0-9]{10,}\\x1D?$/" + "pattern" => "/^\\x1D?420[0-9]{5,11}\\x1D?[0-9]{10,}\\x1D?$/" ], [ "carrier" => "usps", diff --git a/lib/TrackingBarcode.lib.php b/lib/TrackingBarcode.lib.php index 044f48b..c9050f7 100644 --- a/lib/TrackingBarcode.lib.php +++ b/lib/TrackingBarcode.lib.php @@ -30,7 +30,7 @@ class TrackingBarcode { public function getCarrier(): string { $carrier = ""; foreach (Carriers::CARRIER_REGEXES as $p) { - if (preg_match($p["pattern"], strtoupper($this->code))) { + if (preg_match($p["pattern"]."i", $this->code)) { $carrier = $p["carrier"]; break; }