summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_db.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-03-06 08:37:41 +0100
committerAleksander Machniak <alec@alec.pl>2013-03-06 08:37:41 +0100
commitac37746c2ae187edaf38c7a660213e216f90b035 (patch)
treeb0274f8187b95630284f9e6aa1fdc4cc036e8fbe /program/lib/Roundcube/rcube_db.php
parentcbe07532fa4ed3794c872e348be0098575047927 (diff)
Add type 'ident' in quote() so we can quote identifiers (eg. column names) there.
Using array2list() for list of identifiers is now possible.
Diffstat (limited to 'program/lib/Roundcube/rcube_db.php')
-rw-r--r--program/lib/Roundcube/rcube_db.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php
index 88cd22b0e..b1db7ada7 100644
--- a/program/lib/Roundcube/rcube_db.php
+++ b/program/lib/Roundcube/rcube_db.php
@@ -571,7 +571,7 @@ class rcube_db
* Formats input so it can be safely used in a query
*
* @param mixed $input Value to quote
- * @param string $type Type of data
+ * @param string $type Type of data (integer, bool, ident)
*
* @return string Quoted/converted string for use in query
*/
@@ -586,6 +586,10 @@ class rcube_db
return 'NULL';
}
+ if ($type == 'ident') {
+ return $this->quote_identifier($input);
+ }
+
// create DB handle if not available
if (!$this->dbh) {
$this->db_connect('r');
@@ -635,7 +639,7 @@ class rcube_db
$name[] = $start . $elem . $end;
}
- return implode($name, '.');
+ return implode($name, '.');
}
/**
@@ -652,7 +656,7 @@ class rcube_db
* Return list of elements for use with SQL's IN clause
*
* @param array $arr Input array
- * @param string $type Type of data
+ * @param string $type Type of data (integer, bool, ident)
*
* @return string Comma-separated list of quoted values for use in query
*/