Drupal user fns - copy Coleman's code in
authorEileen McNaughton <eileen@mcnaughty.com>
Sun, 20 Oct 2013 22:09:19 +0000 (11:09 +1300)
committerEileen McNaughton <eileen@mcnaughty.com>
Sun, 20 Oct 2013 22:09:19 +0000 (11:09 +1300)
https://github.com/civicrm/civicrm-core/pull/1798/files#r7022773

CRM/Utils/System/Drupal6.php

index 2a504269c55b8ec45fe4fe71a10e7002b93e33d7..47e4b36113cd4103085069c88daab5eeff63f969 100644 (file)
@@ -174,13 +174,10 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
       FROM {users}
       WHERE (LOWER(name) = LOWER('$name')) OR (LOWER(mail) = LOWER('$email'))
     ";
-    $result = db_query($sql);
-    $rows = array();
 
-    if (count($result) > 0) {
-     $rows[] = db_fetch_array($result);
-    }
-    if(empty($rows)) {
+    $result = db_query($sql);
+    $rows = db_fetch_array($result);
+    if (!$rows) {
       return;
     }
     $row = $rows[0];