mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-12-24 23:09:28 -05:00
avoid clever key manipulation, all we need are incremental numbers starting at 1
This commit is contained in:
parent
cf83e3825f
commit
e468f07626
@ -506,8 +506,8 @@ class Database extends AbstractData
|
||||
private function _exec($sql, array $params)
|
||||
{
|
||||
$statement = $this->_db->prepare($sql);
|
||||
foreach ($params as $key => &$parameter) {
|
||||
$position = $key + 1;
|
||||
$position = 1;
|
||||
foreach ($params as &$parameter) {
|
||||
if (is_int($parameter)) {
|
||||
$statement->bindParam($position, $parameter, PDO::PARAM_INT);
|
||||
} elseif (is_string($parameter) && strlen($parameter) >= 4000) {
|
||||
@ -515,6 +515,7 @@ class Database extends AbstractData
|
||||
} else {
|
||||
$statement->bindParam($position, $parameter);
|
||||
}
|
||||
++$position;
|
||||
}
|
||||
$result = $statement->execute();
|
||||
$statement->closeCursor();
|
||||
|
Loading…
Reference in New Issue
Block a user