summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-01 15:23:47 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-01 15:23:47 +0100
commit1a9b7e0d1f96b3cee5692f582d860dca4978dee5 (patch)
treeff48ba62126cb3e6ff3387a687a4cf2bf2782d4d /system/libraries
parent075f6fa31aab069aaa21a4d6f13e3ca850012d05 (diff)
Remove is_numeric() checks from Cart library (superseded by casts to float)
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Cart.php17
1 files changed, 1 insertions, 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)