Chris Kelly
-
2008-05-28
- summary: Case insensitive search --> [G2] Case insensitive search
Not all of us use MySQL as Gallery2 back-end. It would be very nice for the search to be case insensitive.
modules/core/classes/GalleryCoreSearch.class:
$whereList[] = "$column LIKE ?";
$whereData[] = '%' . $criteria . '%';
My modification:
$whereList[] = "lower($column) LIKE ?";
mb_internal_encoding("UTF-8");
$whereData[] = '%' . mb_strtolower($criteria) . '%';
Now searches will be lower-case for all databases having ANSI SQL lower-function. Multi-byte version is required, because regular strtolower does not recognize locale.