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 fc144c4 commit bc1f84e6185907f0287f4a0f820fb87e2d6b53b3 cataluke committed Apr 18, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/data/view.php
View
4 mod/data/view.php
@@ -305,7 +305,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 = ' ';
}
@@ -318,7 +318,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 bc1f84e

Please sign in to comment.