cvs: pear /Auth/Container DB.php
| From: | Adam AShley | Date: | Tue, 21 Feb 2006 23:37:02 +0000 |
| Subject: | cvs: pear /Auth/Container DB.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38477@lists.php.net to get a copy of this message | ||
aashley Tue Feb 21 23:37:02 2006 UTC
Modified files:
/pear/Auth/Container DB.php
Log:
Correct calling of quoteSmart in DB container
http://cvs.php.net/viewcvs.cgi/pear/Auth/Container/DB.php?r1=1.56&r2=1.57&diff_format=u
Index: pear/Auth/Container/DB.php
diff -u pear/Auth/Container/DB.php:1.56 pear/Auth/Container/DB.php:1.57
--- pear/Auth/Container/DB.php:1.56 Tue Feb 21 06:22:38 2006
+++ pear/Auth/Container/DB.php Tue Feb 21 23:37:02 2006
@@ -16,7 +16,7 @@
// | Authors: Martin Jansen <mj@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.56 2006/02/21 06:22:38 aashley Exp $
+// $Id: DB.php,v 1.57 2006/02/21 23:37:02 aashley Exp $
//
require_once 'Auth/Container.php';
@@ -30,7 +30,7 @@
*
* @author Martin Jansen <mj@php.net>
* @package Auth
- * @version $Revision: 1.56 $
+ * @version $Revision: 1.57 $
*/
class Auth_Container_DB extends Auth_Container
{
@@ -246,7 +246,7 @@
$query = "SELECT ".$sql_from.
" FROM ".$this->options['table'].
- " WHERE ".$this->options['usernamecol']." =
'".$this->db->quoteSmart($username)."'";
+ " WHERE ".$this->options['usernamecol']." =
".$this->db->quoteSmart($username);
$res = $this->db->getRow($query, null, DB_FETCHMODE_ASSOC);
#print "SQL: $query <br/>\n";
@@ -367,7 +367,7 @@
}
}
- $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s',
'%s'%s)",
+ $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES (%s, %s%s)",
$this->options['table'],
$this->options['usernamecol'],
$this->options['passwordcol'],
@@ -401,7 +401,7 @@
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
- $query = sprintf("DELETE FROM %s WHERE %s = '%s'",
+ $query = sprintf("DELETE FROM %s WHERE %s = %s",
$this->options['table'],
$this->options['usernamecol'],
$this->db->quoteSmart($username)
@@ -439,7 +439,7 @@
$password = $cryptFunction($password);
- $query = sprintf("UPDATE %s SET %s = '%s' WHERE %s = '%s'",
+ $query = sprintf("UPDATE %s SET %s = %s WHERE %s = %s",
$this->options['table'],
$this->options['passwordcol'],
$this->db->quoteSmart($password),