Welcome Guest, Not a member yet? Register   Sign In
Restrictions on cart name
#1

[eluser]markbarratt[/eluser]
This may be a feature not a bug of the Cart library in svn.

The 'name' part of a cart array appears to be limited by:

1: being in ASCII plus common punctuation, at line 31 of Cart.php:

Code:
var $product_name_rules    = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods

Is there any reason for this restriction? I have titles in both modern European and also occasionally in non-Latin scripts.

2: There appears to be a length restriction on the name item, though I can't find any reference to that in the code: at any rate, items with long titles which otherwise meet the regex validation don't add to the cart.

I could probably work round these issues (as long as the options array will accept long utf-8 strings!) on the grounds that the cart library is pretty spiffing otherwise, but it would be good to know whether these are known limitations, configurable settings, or bugs.

Thanks
#2

[eluser]Roro[/eluser]
About this restriction, it's a huge problem for international applications because this regex doesn't allow accented characters like "é, è, à, ô, ...". In french these characters are very frequent and many french users have to hack CI code to get working the Cart class Sad Sad

Is there a chance to get this restriction revised in 1.7.3 version ?
#3

[eluser]Roro[/eluser]
There is a bug report about the same restriction : http://codeigniter.com/bug_tracker/bug/11495/
I assume that the "brackets or single quotes" restriction is present to prevent SQL injection attacks ?
It's too bad because single quotes are also very often used in french Sad

But for accented characters, I think there is no reason to avoid them...




Theme © iAndrew 2016 - Forum software by © MyBB