Unverified Commit 68cd2e55 authored by alexpott's avatar alexpott

Issue #2932777 by mondrake, borisson_, alexpott, daffie: Risky count() in SQLite Statement

parent 0daa2b52
......@@ -27,7 +27,7 @@ class Statement extends StatementPrefetch implements StatementInterface {
* See http://bugs.php.net/bug.php?id=45259 for more details.
*/
protected function getStatement($query, &$args = []) {
if (count($args)) {
if (is_array($args) && !empty($args)) {
// Check if $args is a simple numeric array.
if (range(0, count($args) - 1) === array_keys($args)) {
// In that case, we have unnamed placeholders.
......
......@@ -44,7 +44,7 @@ interface StatementInterface extends \Traversable {
*
* @param $args
* An array of values with as many elements as there are bound parameters in
* the SQL statement being executed.
* the SQL statement being executed. This can be NULL.
* @param $options
* An array of options for this query.
*
......
......@@ -214,8 +214,8 @@ protected function throwPDOException() {
*
* @param $query
* The query.
* @param array $args
* An array of arguments.
* @param array|null $args
* An array of arguments. This can be NULL.
* @return \PDOStatement
* A PDOStatement object.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment