diff options
Diffstat (limited to 'lib/private/DB/Connection.php')
-rw-r--r-- | lib/private/DB/Connection.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 58d8d114705..1965bb3eee4 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -189,15 +189,20 @@ class Connection extends \Doctrine\DBAL\Connection { * Prepares an SQL statement. * * @param string $statement The SQL statement to prepare. - * @param int $limit - * @param int $offset + * @param int|null $limit + * @param int|null $offset * * @return Statement The prepared statement. * @throws Exception */ public function prepare($statement, $limit = null, $offset = null): Statement { - if ($limit === -1) { + if ($limit === -1 || $limit === null) { $limit = null; + } else { + $limit = (int) $limit; + } + if ($offset !== null) { + $offset = (int) $offset; } if (!is_null($limit)) { $platform = $this->getDatabasePlatform(); |