Permalink
Browse files

MDL-7856 - make database search case-insensitive for PostgreSQL too.

Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
Committer: Luke Hudson <luke@catalyst.net.nz>
  • Loading branch information...
1 parent f35c9f6 commit de06df20a4ce8e4bb7324c185190bd869d2d03f9 cataluke committed Apr 17, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/data/view.php
View
@@ -312,7 +312,7 @@
AND c1.recordid = r.id ';
$sortorder = ' ORDER BY '.$sortcontentfull.' '.$order.' , r.id ASC ';
if ($search) {
- $searchselect = " AND (c1.content LIKE '%$search%') ";
+ $searchselect = ' AND (c1.content ' . sql_ilike() . " '%$search%') "; //Be case-insensitive
} else {
$searchselect = ' ';
}
@@ -325,7 +325,7 @@
AND r.userid = u.id
AND r.dataid = '.$data->id;
$sortorder = ' ORDER BY r.id ASC ';
- $searchselect = " AND (c.content LIKE '%$search%') ";
+ $searchselect = ' AND (c.content ' . sql_ilike() . " '%$search%') "; //Be case-insensitive
} else {
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.userid, u.firstname, u.lastname ';

0 comments on commit de06df2

Please sign in to comment.