diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-05-07 13:08:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 13:08:58 +0300 |
commit | d829c23496c9f1c53bd4144009d67f8a287d97e4 (patch) | |
tree | f3c9770f12528e8c9adee02df33d192e08f9b9b7 /libs | |
parent | 53f3e32686d848ca24295e1320e7ac50932b031e (diff) |
Bind param values manually since PDOStatement::execute() will assume … (#15919)
* Bind param values manually since PDOStatement::execute() will assume params are all strings. This causes null values to not be bound correctly.
* Add insert null value test.
* move test
* undo submodule changes
Diffstat (limited to 'libs')
-rw-r--r-- | libs/Zend/Db/Statement/Pdo.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/Zend/Db/Statement/Pdo.php b/libs/Zend/Db/Statement/Pdo.php index a717728109..4be698afe2 100644 --- a/libs/Zend/Db/Statement/Pdo.php +++ b/libs/Zend/Db/Statement/Pdo.php @@ -225,10 +225,12 @@ class Zend_Db_Statement_Pdo extends Zend_Db_Statement implements IteratorAggrega { try { if ($params !== null) { - return $this->_stmt->execute($params); - } else { - return $this->_stmt->execute(); + foreach (array_values($params) as $index => $paramValue) { + $this->_stmt->bindValue($index + 1, $paramValue, $paramValue === null ? PDO::PARAM_NULL : PDO::PARAM_STR); + } } + + return $this->_stmt->execute(); } catch (PDOException $e) { // require_once 'Zend/Db/Statement/Exception.php'; throw new Zend_Db_Statement_Exception($e->getMessage(), (int) $e->getCode(), $e); |