문제

I faced an issue that I cannot add item to cart if it contain cyrillic name. In Cart.php I added to variable symbols а-я:

var $product_name_rules = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя\.\:\-_ a-z0-9';

But it not resolved issue. When I changed an item name to latin it is added to cart.

도움이 되었습니까?

해결책

You should add unicode flag to pregmatch in _insert function:

if ( ! preg_match("/^[".$this->product_id_rules."]+$/iu", $items['id']))

and

if ( ! preg_match("/^[".$this->product_name_rules."]+$/iu", $items['name']))

There is good article about this issue: http://wwarlock.blogspot.ru/2010/03/codeigniter.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top