diff options
author | Andrey Andreev <narf@bofh.bg> | 2013-04-01 09:34:26 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2013-04-01 09:34:26 +0200 |
commit | 5c18265fb5e5a5d8d71be0a5ff2b1a12e0222585 (patch) | |
tree | 97860ea1ba6311c75e965d915f97d2ea5801e83a /system | |
parent | d2797bbfe5ad7be70688286a523d212a2c910b72 (diff) | |
parent | 65b8f835e572cc6ff73fe07024ffaa537fee912e (diff) |
Merge pull request #2303 from lracicot/develop
Add unicode support in cart product name.
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Cart.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index b7b0697fb..edc300bd7 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -51,7 +51,7 @@ class CI_Cart { * * @var string */ - public $product_name_rules = '\.\:\-_ a-z0-9'; + public $product_name_rules = '\w \-\.\:'; /** * only allow safe product names @@ -214,7 +214,7 @@ 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 && ! preg_match('/^['.$this->product_name_rules.']+$/i', $items['name'])) + if ($this->product_name_safe && ! preg_match('/^['.$this->product_name_rules.']+$/i'.(UTF8_ENABLED ? 'u' : ''), $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; |