Issue #2932777 by mondrake, borisson_, alexpott, daffie: Risky count() in SQLite Statement
parent
0daa2b5227
commit
68cd2e5528
|
@ -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 @@ 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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue