Some friends may find that the Codeigniter shopping cart class cannot add Chinese. After searching for a long time, I found that the following piece of code limits the input of Chinese. Let me introduce it to you.
Modify systemlibrariesCart.php and comment the product name judgment on lines 186-190:
The code is as follows
代码如下 |
复制代码 |
/*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;
}
*/
|
|
Copy code
|
| /*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;
}
*/
However, deleting is not the best way. We can just change the regular matching to Chinese. I will not introduce this, but you can check it out in the PHP tutorial channel.
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632100.htmlTechArticleSome friends may find that the Codeigniter shopping cart class cannot add Chinese. After searching for a long time, I found the following code restriction Now that I have entered Chinese, let me introduce it to you. Modify systemli...