mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
stick to single convention of binding parameters
This commit is contained in:
parent
0cc2b67753
commit
a8e1c33b54
|
@ -548,20 +548,15 @@ class Database extends AbstractData
|
||||||
private static function _exec($sql, array $params)
|
private static function _exec($sql, array $params)
|
||||||
{
|
{
|
||||||
$statement = self::$_db->prepare($sql);
|
$statement = self::$_db->prepare($sql);
|
||||||
if (self::$_type === 'oci') {
|
foreach ($params as $key => $parameter) {
|
||||||
// It is not possible to execute in the normal way if strlen($param) >= 4000
|
$position = $key + 1;
|
||||||
foreach ($params as $key => $parameter) {
|
if (is_int($parameter)) {
|
||||||
$position = $key + 1;
|
$statement->bindValue($position, $parameter, PDO::PARAM_INT);
|
||||||
if (is_int($parameter)) {
|
} else {
|
||||||
$statement->bindValue($position, $parameter, PDO::PARAM_INT);
|
$statement->bindValue($position, $parameter);
|
||||||
} else {
|
|
||||||
$statement->bindValue($position, $parameter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$result = $statement->execute();
|
|
||||||
} else {
|
|
||||||
$result = $statement->execute($params);
|
|
||||||
}
|
}
|
||||||
|
$result = $statement->execute();
|
||||||
$statement->closeCursor();
|
$statement->closeCursor();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user