aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-10-15 00:08:40 +0200
committerGravatar GitHub <noreply@github.com> 2025-10-15 00:08:40 +0200
commite070c3ed2bec4ea4a6c2a216a5c836d1e02ab381 (patch)
treec65a238580dc5b78c6cf6a1947523ff6291eaa0a /lib
parent1b8bc1ae8b9810eb66ff798093b89d2ce690373f (diff)
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. <img width="939" height="1438" alt="image" src="https://github.com/user-attachments/assets/0bcad39b-eff3-4f44-876b-a2552af2af00" /> * Consistency: allow multiple user queries like S:1,2 * Fix user query and add tests
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Request.php12
1 files changed, 12 insertions, 0 deletions
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<int>
+ */
+ 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];