Skip to content

Commit

Permalink
Fix #7: Search in PostgreSQL is case-sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
webinarium committed Apr 2, 2015
1 parent fcf424c commit 41987e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dbo/records.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ function records_list ($columns, &$sort, &$page, $search_mode = FALSE, $search_t

$search_text = "'%" . ustr2sql(ustrtolower($search_text)) . "%'";

$search_in_subject = (DATABASE_DRIVER == DRIVER_ORACLE9 ? 'lower' : NULL) . '(r.subject) like ' . $search_text;
$search_in_svalues = (DATABASE_DRIVER == DRIVER_ORACLE9 ? 'lower' : NULL) . '(sv.string_value) like ' . $search_text;
$search_in_tvalues = (DATABASE_DRIVER == DRIVER_ORACLE9 ? 'lower' : NULL) . '(tv.text_value) like ' . $search_text;
$search_in_comments = (DATABASE_DRIVER == DRIVER_ORACLE9 ? 'lower' : NULL) . '(c.comment_body) like ' . $search_text;
$search_in_subject = (in_array(DATABASE_DRIVER, array(DRIVER_ORACLE9, DRIVER_PGSQL80)) ? 'lower' : NULL) . '(r.subject) like ' . $search_text;
$search_in_svalues = (in_array(DATABASE_DRIVER, array(DRIVER_ORACLE9, DRIVER_PGSQL80)) ? 'lower' : NULL) . '(sv.string_value) like ' . $search_text;
$search_in_tvalues = (in_array(DATABASE_DRIVER, array(DRIVER_ORACLE9, DRIVER_PGSQL80)) ? 'lower' : NULL) . '(tv.text_value) like ' . $search_text;
$search_in_comments = (in_array(DATABASE_DRIVER, array(DRIVER_ORACLE9, DRIVER_PGSQL80)) ? 'lower' : NULL) . '(c.comment_body) like ' . $search_text;

array_push($search,
'select r.record_id ' .
Expand Down

0 comments on commit 41987e5

Please sign in to comment.