From b31003541e538d499a5e1dddc250e34e5a26282c Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sun, 3 Mar 2013 17:12:57 +0200 Subject: Fixes for issue 8 --- gsxlib.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gsxlib.php') diff --git a/gsxlib.php b/gsxlib.php index a12e8c0..43ba53a 100644 --- a/gsxlib.php +++ b/gsxlib.php @@ -407,13 +407,11 @@ class GsxLib */ public function warrantyStatus($serialNumber) { - if(!$this->isValidSerialNumber($serialNumber)) { - exit('Invalid serial number: ' . $serialNumber); + if( !is_array( $serialNumber )) { + $serialNumber = array('serialNumber' => $serialNumber); } - $req = array('WarrantyStatus' => array( - 'unitDetail' => array('serialNumber' => $serialNumber) - )); + $req = array( 'WarrantyStatus' => array( 'unitDetail' => $serialNumber )); return $this->request($req)->warrantyDetailInfo; @@ -466,6 +464,7 @@ class GsxLib public function isValidSerialNumber($serialNumber) { $serialNumber = trim( $serialNumber ); + // SNs should never start with an S, but they're often coded into barcodes // and since an "old- ormat" SN + S would still qualify as a "new format" SN, // we strip it here and not in self::looksLike -- cgit v1.2.3