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

merge-requests/1654/head
Alex Pott 2018-06-09 11:13:36 +01:00
parent 0daa2b5227
commit 68cd2e5528
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
3 changed files with 4 additions and 4 deletions

View File

@ -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.

View File

@ -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.
*

View File

@ -214,8 +214,8 @@ class StatementPrefetch implements \Iterator, StatementInterface {
*
* @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.
*/