Permalink
Browse files

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

Signed-off-by: Luke Hudson <luke@catalyst.net.nz>


Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
Committer: Luke Hudson <luke@catalyst.net.nz>
  • Loading branch information...
cataluke
cataluke committed Apr 17, 2007
1 parent 8f4c3da commit b2787982b7309e6faccc182d2b2962610ac41856
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/data/view.php
View
@@ -309,7 +309,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 = ' ';
}
@@ -322,7 +322,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 b278798

Please sign in to comment.