summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Cart.php9
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 4 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;
}
// --------------------------------------------------------------------
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 71104418a..eda64e7ff 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -48,6 +48,7 @@ Release Date: Not Released
- Modified valid_ip() to use PHP's filter_var() when possible (>= PHP 5.2) in the :doc:`Form Validation library <libraries/form_validation>`.
- Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname)
- The Cart library now auto-increments quantity's instead of just resetting it, this is the default behaviour of large e-commerce sites.
+ - Cart Product Name strictness can be disabled via the Cart Library by switching "$product_name_safe"
- Core