From 4908f533f360a97350ab8b1dad233e933324e7d3 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 17 Dec 2022 11:41:13 +0100 Subject: [PATCH] better search split for bad URL --- _public.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/_public.php b/_public.php index 23f53fe..3ac5d91 100644 --- a/_public.php +++ b/_public.php @@ -227,7 +227,12 @@ class pubSaba self::getPostsParams($p); $OR = []; - foreach (explode(',', $p['search']) as $sentence) { + # decoupe un peu plus la recherche + $splits = preg_split("#[\s//,-_]+#", $p['search']); + if (!$splits) { + $splits = explode(',', $p['search']); + } + foreach ($splits as $sentence) { $AND = []; $words = text::splitWords($sentence); foreach ($words as $word) {