mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
Merge pull request #932 from PrivateBin/php-8.1-deprecations
addressing deprecation warnings in php 8.1
This commit is contained in:
commit
d9857017de
|
@ -277,9 +277,9 @@ class Database extends AbstractData
|
|||
}
|
||||
|
||||
// support v1 attachments
|
||||
if (array_key_exists('attachment', $paste) && strlen($paste['attachment'])) {
|
||||
if (array_key_exists('attachment', $paste) && !empty($paste['attachment'])) {
|
||||
self::$_cache[$pasteid]['attachment'] = $paste['attachment'];
|
||||
if (array_key_exists('attachmentname', $paste) && strlen($paste['attachmentname'])) {
|
||||
if (array_key_exists('attachmentname', $paste) && !empty($paste['attachmentname'])) {
|
||||
self::$_cache[$pasteid]['attachmentname'] = $paste['attachmentname'];
|
||||
}
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ class Database extends AbstractData
|
|||
$position = $key + 1;
|
||||
if (is_int($parameter)) {
|
||||
$statement->bindParam($position, $parameter, PDO::PARAM_INT);
|
||||
} elseif (strlen($parameter) >= 4000) {
|
||||
} elseif (is_string($parameter) && strlen($parameter) >= 4000) {
|
||||
$statement->bindParam($position, $parameter, PDO::PARAM_STR, strlen($parameter));
|
||||
} else {
|
||||
$statement->bindParam($position, $parameter);
|
||||
|
|
Loading…
Reference in New Issue
Block a user