浏览代码

using case insensitive lookups that don't depend on sql server string comparison options.
mysql tested by me, postgresql tested by Patrick Welche <prlw1 at newn.cam.ac.uk>

tokul 21 年之前
父节点
当前提交
044e1c12c8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      functions/abook_database.php

+ 1 - 1
functions/abook_database.php

@@ -173,7 +173,7 @@ class abook_database extends addressbook_backend {
             return false;
             return false;
         }
         }
          
          
-        $query = sprintf("SELECT * FROM %s WHERE owner='%s' AND nickname='%s'",
+        $query = sprintf("SELECT * FROM %s WHERE owner='%s' AND LOWER(nickname)='%s'",
                          $this->table, $this->owner, $this->dbh->quoteString($alias));
                          $this->table, $this->owner, $this->dbh->quoteString($alias));
 
 
         $res = $this->dbh->query($query);
         $res = $this->dbh->query($query);