From 9ac8246fa21af92960d9f74cc524eb9f8610cc6c Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 27 Jan 2020 22:22:07 +0000 Subject: [PATCH] fixes --- core/database.php | 4 ++-- ext/handle_pixel/main.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/database.php b/core/database.php index 2db27e42..c30489b7 100644 --- a/core/database.php +++ b/core/database.php @@ -271,7 +271,7 @@ class Database } /** - * Execute an SQL query and return a single value. + * Execute an SQL query and return a single value, or null. */ public function get_one(string $query, array $args=[], bool $scoreql = false) { @@ -281,7 +281,7 @@ class Database $_start = microtime(true); $row = $this->execute($query, $args)->fetch(); $this->count_time("get_one", $_start, $query, $args); - return $row[0]; + return $row ? $row[0] : null; } /** diff --git a/ext/handle_pixel/main.php b/ext/handle_pixel/main.php index f13fc79f..41aff1cc 100644 --- a/ext/handle_pixel/main.php +++ b/ext/handle_pixel/main.php @@ -70,7 +70,7 @@ class PixelFileHandler extends DataHandlerExtension return false; } $info = getimagesize($tmpname); - if (is_null($info)) { + if (!$info) { return false; } if (in_array($info[2], $valid)) {