fix: empty array is not a valid PdoStatement::execute param
This commit is contained in:
@@ -27,7 +27,7 @@ class Connection
|
|||||||
public static function execute($sql, $values = array(), $fetchMode = \PDO::FETCH_ASSOC)
|
public static function execute($sql, $values = array(), $fetchMode = \PDO::FETCH_ASSOC)
|
||||||
{
|
{
|
||||||
$statement = PDOWithFilters::prepare($sql);
|
$statement = PDOWithFilters::prepare($sql);
|
||||||
$success = $statement->execute($values);
|
$success = $statement->execute(!empty($values) ? $values : null);
|
||||||
|
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
$statement->closeCursor();
|
$statement->closeCursor();
|
||||||
|
|||||||
Reference in New Issue
Block a user