]> git.mjollnir.org Git - moodle.git/commitdiff
searchlib can use sql_ilike too!
authormartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:08:39 +0000 (05:08 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:08:39 +0000 (05:08 +0000)
lib/searchlib.php

index 75849fb654eb5e82ab72f5ef483ea819b67698cb..b3f6a567918efd61dddc52132ff2d1f99501bfb5 100644 (file)
@@ -314,14 +314,12 @@ function search_generate_SQL($parsetree, $datafield, $metafield, $mainidfield, $
                              $userfirstnamefield, $userlastnamefield, $timefield, $instancefield) {
     global $CFG;
 
+    $LIKE = sql_ilike();
+    $NOTLIKE = 'NOT ' . $LIKE;
     if ($CFG->dbtype == "postgres7") {
-        $LIKE = "ILIKE";   // case-insensitive
-        $NOTLIKE = "NOT ILIKE";   // case-insensitive
         $REGEXP = "~*";
         $NOTREGEXP = "!~*";
     } else {
-        $LIKE = "LIKE";
-        $NOTLIKE = "NOT LIKE";
         $REGEXP = "REGEXP";
         $NOTREGEXP = "NOT REGEXP";
     }