From 3b47e0ed7184fa646372627d70534a774b593035 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 8 Nov 2022 17:10:23 +0100 Subject: [PATCH] Model: Query ':' types can reuse parameters --- app/model/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/model/Model.php b/app/model/Model.php index 5996f10..ea511f3 100644 --- a/app/model/Model.php +++ b/app/model/Model.php @@ -98,7 +98,7 @@ abstract class Model { protected static function query(string $query, array $parameters = [], $type = ':'): ?array { - if (substr_count($query, $type) != count($parameters)) { + if ($type == '?' && substr_count($query, $type) != count($parameters)) { return null; }