From 1a9b7e0d1f96b3cee5692f582d860dca4978dee5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 16:23:47 +0200 Subject: Remove is_numeric() checks from Cart library (superseded by casts to float) --- system/libraries/Cart.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index d4b17fa36..6cc7ee230 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -193,7 +193,7 @@ class CI_Cart { $items['qty'] = (float) $items['qty']; // If the quantity is zero or blank there's nothing for us to do - if ( ! is_numeric($items['qty']) OR $items['qty'] == 0) + if ($items['qty'] == 0) { return FALSE; } @@ -224,15 +224,6 @@ class CI_Cart { // Prep the price. Remove leading zeros and anything that isn't a number or decimal point. $items['price'] = (float) $items['price']; - // Is the price a valid number? - if ( ! is_numeric($items['price'])) - { - log_message('error', 'An invalid price was submitted for product ID: '.$items['id']); - return FALSE; - } - - // -------------------------------------------------------------------- - // We now need to create a unique identifier for the item being inserted into the cart. // Every time something is added to the cart it is stored in the master cart array. // Each row in the cart array, however, must have a unique index that identifies not only @@ -350,12 +341,6 @@ class CI_Cart { // Prep the quantity $items['qty'] = (float) $items['qty']; - // Is the quantity a number? - if ( ! is_numeric($items['qty'])) - { - return FALSE; - } - // Is the quantity zero? If so we will remove the item from the cart. // If the quantity is greater than zero we are updating if ($items['qty'] == 0) -- cgit v1.2.3-24-g4f1b