From e070c3ed2bec4ea4a6c2a216a5c836d1e02ab381 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 15 Oct 2025 00:08:40 +0200 Subject: Implement search form (#8103) * Add UI for advanced search To help users with the seach operators. Obviously not as powerful as a manually-written search query. Lack in particular negation and logical *and* for now, but I might try to do something about it. image * Consistency: allow multiple user queries like S:1,2 * Fix user query and add tests --- lib/Minz/Request.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/Minz') diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 4bf6fa45c..c938afd7c 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -99,6 +99,18 @@ class Minz_Request { return $plaintext ? $result : Minz_Helper::htmlspecialchars_utf8($result); } + /** + * @return list + */ + public static function paramArrayInt(string $key): array { + if (empty(self::$params[$key]) || !is_array(self::$params[$key])) { + return []; + } + $result = array_filter(self::$params[$key], 'is_numeric'); + $result = array_map('intval', $result); + return array_values($result); + } + public static function paramTernary(string $key): ?bool { if (isset(self::$params[$key])) { $p = self::$params[$key]; -- cgit v1.2.3