From a522971cf853b2f0ccd1b569491a06218ebbaee9 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 08 May 2013 08:28:36 -0400
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail

---
 plugins/password/drivers/sql.php |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php
index e02bff1..7a51dfe 100644
--- a/plugins/password/drivers/sql.php
+++ b/plugins/password/drivers/sql.php
@@ -34,8 +34,9 @@
             $db = $rcmail->get_dbh();
         }
 
-        if ($err = $db->is_error())
+        if ($db->is_error()) {
             return PASSWORD_ERROR;
+        }
 
         // crypted password
         if (strpos($sql, '%c') !== FALSE) {
@@ -183,8 +184,8 @@
         $res = $db->query($sql, $sql_vars);
 
         if (!$db->is_error()) {
-            if (strtolower(substr(trim($query),0,6))=='select') {
-                if ($result = $db->fetch_array($res))
+            if (strtolower(substr(trim($sql),0,6)) == 'select') {
+                if ($db->fetch_array($res))
                     return PASSWORD_SUCCESS;
             } else {
                 // This is the good case: 1 row updated

--
Gitblit v1.9.1