From 0cc2b677538ac948132c1ee674c433ccdf104640 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 23 Jan 2022 21:45:22 +0100 Subject: [PATCH] bindValue doesn't need the length --- lib/Data/Database.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Data/Database.php b/lib/Data/Database.php index 1441648..583c400 100644 --- a/lib/Data/Database.php +++ b/lib/Data/Database.php @@ -395,7 +395,7 @@ class Database extends AbstractData // create comment list $comments = array(); - if (count($rows)) { + if (is_array($rows) && count($rows)) { foreach ($rows as $row) { $i = $this->getOpenSlot($comments, (int) $row['postdate']); $data = Json::decode($row['data']); @@ -527,7 +527,7 @@ class Database extends AbstractData (self::$_type === 'oci' ? 'FETCH NEXT ? ROWS ONLY' : 'LIMIT ?'), array(time(), 0, $batchsize) ); - if (count($rows)) { + if (is_array($rows) && count($rows)) { foreach ($rows as $row) { $pastes[] = $row['dataid']; } @@ -554,8 +554,6 @@ class Database extends AbstractData $position = $key + 1; if (is_int($parameter)) { $statement->bindValue($position, $parameter, PDO::PARAM_INT); - } elseif ($length = strlen($parameter) >= 4000) { - $statement->bindValue($position, $parameter, PDO::PARAM_STR, $length); } else { $statement->bindValue($position, $parameter); }