mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-01-11 23:39:43 -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)
|
private function _exec($sql, array $params)
|
||||||
{
|
{
|
||||||
$statement = $this->_db->prepare($sql);
|
$statement = $this->_db->prepare($sql);
|
||||||
foreach ($params as $key => &$parameter) {
|
$position = 1;
|
||||||
$position = $key + 1;
|
foreach ($params as &$parameter) {
|
||||||
if (is_int($parameter)) {
|
if (is_int($parameter)) {
|
||||||
$statement->bindParam($position, $parameter, PDO::PARAM_INT);
|
$statement->bindParam($position, $parameter, PDO::PARAM_INT);
|
||||||
} elseif (is_string($parameter) && strlen($parameter) >= 4000) {
|
} elseif (is_string($parameter) && strlen($parameter) >= 4000) {
|
||||||
@ -515,6 +515,7 @@ class Database extends AbstractData
|
|||||||
} else {
|
} else {
|
||||||
$statement->bindParam($position, $parameter);
|
$statement->bindParam($position, $parameter);
|
||||||
}
|
}
|
||||||
|
++$position;
|
||||||
}
|
}
|
||||||
$result = $statement->execute();
|
$result = $statement->execute();
|
||||||
$statement->closeCursor();
|
$statement->closeCursor();
|
||||||
|
Loading…
Reference in New Issue
Block a user