creocoder / yii2-taggable

The taggable behavior for the Yii framework.
Other
134 stars 33 forks source link

Case sensitivity #17

Open halfahad opened 9 years ago

halfahad commented 9 years ago

I've had some problems with case sensitivity on inputting tags.

Because of MySQL SELECT statements are not case-sensitive by default: if 'foo' exists as a tag and 'Foo' was inputted, it would would cause a double entry insert statement which because of the composite primary key uniqueness would throw an SQL error and rollback the transaction.

I would suggest adding an attribute or property forcing all incoming tags to lower-case as default. and when disabled, choose to do a binary mysql statement instead: SELECT * FROM table WHERE BINARY column = 'value

any ideas on this, or do you have any suggestions on how to filter the $tagValues at the MODEL level?