From 0728849ea4174b0a02e312b2fb79eccf2564c8d6 Mon Sep 17 00:00:00 2001 From: Brian Huisman Date: Fri, 19 May 2023 12:22:21 -0400 Subject: [PATCH] Update search.php Ensure that important or negative match strings are not empty. --- orcinus/search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orcinus/search.php b/orcinus/search.php index 0fd7ab6..8ef8609 100644 --- a/orcinus/search.php +++ b/orcinus/search.php @@ -131,13 +131,13 @@ if ($_RDATA['s_searchable_pages']) { if (!$t) continue; // Leading + means important, a MUST match - if ($t[0] == '+') { + if ($t[0] == '+' && strlen($t) > 1) { // Just count it as a 'phrase' of one word, functionally equivalent $_SDATA['terms'][] = array('phrase', substr($t, 1), false); // Leading - means negative, a MUST exclude - } else if ($t[0] == '-') { + } else if ($t[0] == '-' && strlen($t) > 1) { $_SDATA['terms'][] = array('exclude', substr($t, 1), false); // Restrict to a specific filetype (not yet implemented)