[Pkg-owncloud-commits] [php-sabredav] 12/66: Column 'username' is not needed for getting the digest

David Prévot taffit at moszumanska.debian.org
Sat Jan 18 20:08:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 25b988174a136f4f7a333571e5d3fab60fce4c2e
Author: Jan Pieper <jan.pieper at adcloud.com>
Date:   Fri Nov 29 13:29:41 2013 +0100

    Column 'username' is not needed for getting the digest
    
    * Use PDOStatement::fetchColumn()
---
 lib/Sabre/DAV/Auth/Backend/PDO.php | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/Sabre/DAV/Auth/Backend/PDO.php b/lib/Sabre/DAV/Auth/Backend/PDO.php
index 1bc6699..a43e490 100644
--- a/lib/Sabre/DAV/Auth/Backend/PDO.php
+++ b/lib/Sabre/DAV/Auth/Backend/PDO.php
@@ -52,13 +52,9 @@ class PDO extends AbstractDigest {
      */
     public function getDigestHash($realm,$username) {
 
-        $stmt = $this->pdo->prepare('SELECT username, digesta1 FROM '.$this->tableName.' WHERE username = ?');
+        $stmt = $this->pdo->prepare('SELECT digesta1 FROM '.$this->tableName.' WHERE username = ?');
         $stmt->execute(array($username));
-        $result = $stmt->fetchAll();
-
-        if (!count($result)) return;
-
-        return $result[0]['digesta1'];
+        return $stmt->fetchColumn() ?: null;
 
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list