diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/statistics/statistics.admin.inc | 4 | ||||
-rw-r--r-- | modules/system/system.install | 2 | ||||
-rw-r--r-- | modules/user/user.module | 8 | ||||
-rw-r--r-- | modules/user/user.pages.inc | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc index 303eafa44..b9e986b85 100644 --- a/modules/statistics/statistics.admin.inc +++ b/modules/statistics/statistics.admin.inc @@ -160,7 +160,7 @@ function statistics_top_referrers() { $query->addExpression('MAX(timestamp)', 'last'); $query ->fields('a', array('url')) - ->where('LOWER(url) NOT LIKE :host', array(':host' => '%' . $_SERVER['HTTP_HOST'] . '%')) + ->condition('url', '%' . $_SERVER['HTTP_HOST'] . '%', 'NOT LIKE') ->condition('url', '', '<>') ->groupBy('url') ->limit(30) @@ -169,7 +169,7 @@ function statistics_top_referrers() { $count_query = db_select('accesslog', 'a', array('target' => 'slave')); $count_query->addExpression('COUNT(DISTINCT url)'); $count_query - ->where('LOWER(url) NOT LIKE :host', array(':host' => '%' . $_SERVER['HTTP_HOST'] . '%')) + ->condition('url', '%' . $_SERVER['HTTP_HOST'] . '%', 'NOT LIKE') ->condition('url', '', '<>'); $query->setCountQuery($count_query); diff --git a/modules/system/system.install b/modules/system/system.install index c414d99b1..ccdcad65c 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1764,7 +1764,7 @@ function system_update_7003() { )); $or = db_condition('or'); foreach ($result as $allowed) { - $or->where('LOWER(ip) LIKE LOWER(:mask)', array(':mask' => $allowed->mask)); + $or->condition('ip', $allowed->mask, 'LIKE'); } if (count($or)) { db_delete('blocked_ips') diff --git a/modules/user/user.module b/modules/user/user.module index 0d3fced7f..21398fa0b 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -856,11 +856,11 @@ function user_search_execute($keys = NULL) { if (user_access('administer users')) { // Administrators can also search in the otherwise private email field. $query->condition(db_or()-> - where('LOWER(name) LIKE LOWER(:name)', array(':name' => "%$keys%"))-> - where('LOWER(mail) LIKE LOWER(:mail)', array(':mail' => "%$keys%"))); + condition('name', '%' . db_like($keys) . '%', 'LIKE')-> + condition('mail', '%' . db_like($keys) . '%', 'LIKE')); } else { - $query->where('LOWER(name) LIKE LOWER(:name)', array(':name' => "%$keys%")); + $query->condition('name', '%' . db_like($keys) . '%', 'LIKE'); } $result = $query ->limit(15) @@ -1125,7 +1125,7 @@ function user_account_form_validate($form, &$form_state) { if ($error = user_validate_mail($form_state['values']['mail'])) { form_set_error('mail', $error); } - elseif ((bool) db_query_range("SELECT 1 FROM {users} WHERE uid <> :uid AND LOWER(mail) = LOWER(:mail)", 0, 1, array(':uid' => $account->uid, ':mail' => $form_state['values']['mail']))->fetchField()) { + elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($form_state['values']['mail']), 'LIKE')->range(0, 1)->execute()->fetchField()) { // Format error message dependent on whether the user is logged in or not. if ($GLOBALS['user']->uid) { form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $form_state['values']['mail']))); diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index 4d2a575f6..7f40eadd6 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -12,7 +12,7 @@ function user_autocomplete($string = '') { $matches = array(); if ($string) { - $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER(:name)", 0, 10, array(':name' => $string . '%')); + $result = db_select('users')->fields('users', array('name'))->condition('name', db_like($string) . '%', 'LIKE')->range(0, 10)->execute(); foreach ($result as $user) { $matches[$user->name] = check_plain($user->name); } |