Aleksander Machniak
2013-03-06 9eb6d9e46a0a58019381cc328c114d40a231639b
Add type 'ident' in quote() so we can quote identifiers (eg. column names) there.
Using array2list() for list of identifiers is now possible.
1 files modified
10 ■■■■ changed files
program/lib/Roundcube/rcube_db.php 10 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db.php
@@ -571,7 +571,7 @@
     * 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
     */
@@ -584,6 +584,10 @@
        if (is_null($input)) {
            return 'NULL';
        }
        if ($type == 'ident') {
            return $this->quote_identifier($input);
        }
        // create DB handle if not available
@@ -635,7 +639,7 @@
            $name[] = $start . $elem . $end;
        }
        return  implode($name, '.');
        return implode($name, '.');
    }
    /**
@@ -652,7 +656,7 @@
     * 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
     */