summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cart.php
diff options
context:
space:
mode:
authorAndrew Seymour <commit@andrewseymour.co.uk>2011-12-13 16:50:52 +0100
committerAndrew Seymour <commit@andrewseymour.co.uk>2011-12-13 16:50:52 +0100
commit3dd66631330841e4d0e29a95fc279a5d5cc921f2 (patch)
tree7faf3b65b48cc9e16192be69c7e3e13fd85d7211 /system/libraries/Cart.php
parent2e5bda3bde171e71306c80479f04d886127d88a2 (diff)
Merged the two if's together as suggested by @philsturgeon - updated the Changelog to include something that may be important
Diffstat (limited to 'system/libraries/Cart.php')
-rw-r--r--system/libraries/Cart.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index 13485a3ee..f9f3bca47 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -196,13 +196,10 @@ class CI_Cart {
// Validate the product name. It can only be alpha-numeric, dashes, underscores, colons or periods.
// Note: These can be user-specified by setting the $this->product_name_rules variable.
- if($this->product_name_safe)
+ if ( $this->product_name_safe && ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name']))
{
- if ( ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name']))
- {
- log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces');
- return FALSE;
- }
+ log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces');
+ return FALSE;
}
// --------------------------------------------------------------------