diff options
author | Filipp Lepalaan <f@230.to> | 2013-03-03 17:12:57 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-03-03 17:12:57 +0200 |
commit | b31003541e538d499a5e1dddc250e34e5a26282c (patch) | |
tree | 0eda9c9889af50a8f9d5214e3e784e93cc4707dc /gsxlib.php | |
parent | d8736a288d475900d0c19a96084740c3de07dd8a (diff) | |
download | gsxlib-b31003541e538d499a5e1dddc250e34e5a26282c.tar.gz gsxlib-b31003541e538d499a5e1dddc250e34e5a26282c.tar.bz2 gsxlib-b31003541e538d499a5e1dddc250e34e5a26282c.zip |
Fixes for issue 8
Diffstat (limited to 'gsxlib.php')
-rw-r--r-- | gsxlib.php | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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 |