cvs: pear /Auth/Container MDB2.php
| From: | Adam Ashley | Date: | Mon, 21 Aug 2006 02:18:48 +0000 |
| Subject: | cvs: pear /Auth/Container MDB2.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-41774@lists.php.net to get a copy of this message | ||
aashley Mon Aug 21 02:18:48 2006 UTC
Modified files:
/pear/Auth/Container MDB2.php
Log:
Let MDB2 decided whether identifier quoting should be performed
http://cvs.php.net/viewvc.cgi/pear/Auth/Container/MDB2.php?r1=1.13&r2=1.14&diff_format=u
Index: pear/Auth/Container/MDB2.php
diff -u pear/Auth/Container/MDB2.php:1.13 pear/Auth/Container/MDB2.php:1.14
--- pear/Auth/Container/MDB2.php:1.13 Thu Aug 17 01:03:52 2006
+++ pear/Auth/Container/MDB2.php Mon Aug 21 02:18:48 2006
@@ -18,7 +18,7 @@
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
- * @version CVS: $Id: MDB2.php,v 1.13 2006/08/17 01:03:52 aashley Exp $
+ * @version CVS: $Id: MDB2.php,v 1.14 2006/08/21 02:18:48 aashley Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.3.0
*/
@@ -44,7 +44,7 @@
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
- * @version Release: @package_version@ File: $Revision: 1.13 $
+ * @version Release: @package_version@ File: $Revision: 1.14 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.3.0
*/
@@ -229,12 +229,12 @@
if (is_array($this->options['db_fields'])) {
$fields = array();
foreach ($this->options['db_fields'] as $field) {
- $fields[] = $this->db->quoteIdentifier($field);
+ $fields[] = $this->db->quoteIdentifier($field, true);
}
return implode(', ', $fields);
} else {
if (strlen($this->options['db_fields']) > 0) {
- return
$this->db->quoteIdentifier($this->options['db_fields']);
+ return
$this->db->quoteIdentifier($this->options['db_fields'], true);
}
}
}
@@ -273,8 +273,8 @@
if (strstr($this->options['db_fields'], '*')) {
$sql_from = '*';
} else {
- $sql_from =
$this->db->quoteIdentifier($this->options['usernamecol']).
- ",
".$this->db->quoteIdentifier($this->options['passwordcol']);
+ $sql_from =
$this->db->quoteIdentifier($this->options['usernamecol'], true).
+ ",
".$this->db->quoteIdentifier($this->options['passwordcol'], true);
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
@@ -282,8 +282,8 @@
}
$query = sprintf("SELECT %s FROM %s WHERE %s = %s",
$sql_from,
- $this->db->quoteIdentifier($this->options['table']),
-
$this->db->quoteIdentifier($this->options['usernamecol']),
+ $this->db->quoteIdentifier($this->options['table'],
true),
+
$this->db->quoteIdentifier($this->options['usernamecol'], true),
$this->db->quote($username, 'text')
);
@@ -350,8 +350,8 @@
if (strstr($this->options['db_fields'], '*')) {
$sql_from = '*';
} else {
- $sql_from =
$this->db->quoteIdentifier($this->options['usernamecol']).
- ",
".$this->db->quoteIdentifier($this->options['passwordcol']);
+ $sql_from =
$this->db->quoteIdentifier($this->options['usernamecol'], true).
+ ",
".$this->db->quoteIdentifier($this->options['passwordcol'], true);
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
@@ -360,7 +360,7 @@
$query = sprintf('SELECT %s FROM %s',
$sql_from,
- $this->db->quoteIdentifier($this->options['table'])
+ $this->db->quoteIdentifier($this->options['table'],
true)
);
$res = $this->db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
@@ -412,15 +412,15 @@
if (is_array($additional)) {
foreach ($additional as $key => $value) {
- $additional_key .= ', ' . $this->db->quoteIdentifier($key);
+ $additional_key .= ', ' . $this->db->quoteIdentifier($key, true);
$additional_value .= ', ' . $this->db->quote($value,
'text');
}
}
$query = sprintf("INSERT INTO %s (%s, %s%s) VALUES (%s, %s%s)",
- $this->db->quoteIdentifier($this->options['table']),
-
$this->db->quoteIdentifier($this->options['usernamecol']),
-
$this->db->quoteIdentifier($this->options['passwordcol']),
+ $this->db->quoteIdentifier($this->options['table'],
true),
+
$this->db->quoteIdentifier($this->options['usernamecol'], true),
+
$this->db->quoteIdentifier($this->options['passwordcol'], true),
$additional_key,
$this->db->quote($username, 'text'),
$this->db->quote($password, 'text'),
@@ -455,8 +455,8 @@
}
$query = sprintf("DELETE FROM %s WHERE %s = %s",
- $this->db->quoteIdentifier($this->options['table']),
-
$this->db->quoteIdentifier($this->options['usernamecol']),
+ $this->db->quoteIdentifier($this->options['table'],
true),
+
$this->db->quoteIdentifier($this->options['usernamecol'], true),
$this->db->quote($username, 'text')
);
@@ -496,10 +496,10 @@
$password = $cryptFunction($password);
$query = sprintf("UPDATE %s SET %s = %s WHERE %s = %s",
- $this->db->quoteIdentifier($this->options['table']),
-
$this->db->quoteIdentifier($this->options['passwordcol']),
+ $this->db->quoteIdentifier($this->options['table'],
true),
+
$this->db->quoteIdentifier($this->options['passwordcol'], true),
$this->db->quote($password, 'text'),
-
$this->db->quoteIdentifier($this->options['usernamecol']),
+
$this->db->quoteIdentifier($this->options['usernamecol'], true),
$this->db->quote($username, 'text')
);