aboutsummaryrefslogtreecommitdiffstats
path: root/gsxlib.php
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-03-03 17:12:57 +0200
committerFilipp Lepalaan <f@230.to>2013-03-03 17:12:57 +0200
commitb31003541e538d499a5e1dddc250e34e5a26282c (patch)
tree0eda9c9889af50a8f9d5214e3e784e93cc4707dc /gsxlib.php
parentd8736a288d475900d0c19a96084740c3de07dd8a (diff)
downloadgsxlib-b31003541e538d499a5e1dddc250e34e5a26282c.tar.gz
gsxlib-b31003541e538d499a5e1dddc250e34e5a26282c.tar.bz2
gsxlib-b31003541e538d499a5e1dddc250e34e5a26282c.zip
Fixes for issue 8
Diffstat (limited to 'gsxlib.php')
-rw-r--r--gsxlib.php9
1 files changed, 4 insertions, 5 deletions
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