From 816a349d06ad5ec980e1f217884c67463f2060fb Mon Sep 17 00:00:00 2001 From: LaurentGH <31282893+LaurentGH@users.noreply.github.com> Date: Mon, 17 Nov 2025 11:28:16 +0100 Subject: [PATCH] Fix a known search issue related to negative note keyword When a user searches _-note:store_ the results now contains: - articles with a note different of "store" - articles with no notes Indeed, the NULL case was not handled, so articles without a note were not displayed. --- classes/Feeds.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/Feeds.php b/classes/Feeds.php index d02665050..85e433b1d 100644 --- a/classes/Feeds.php +++ b/classes/Feeds.php @@ -2223,6 +2223,11 @@ class Feeds extends Handler_Protected { switch ($keyword_name) { case 'title': + /** + * Known issue: a Search Query containing spaces like _title:" be "_ + * matches "cyBErspace", and not only " be ", because the spaces + * are trimmed by the two trim() above. + */ $query_keywords[] = "($not (LOWER(ttrss_entries.title) LIKE " . $pdo->quote("%{$keyword_value}%") . '))'; $valid_keyword_processed = true; @@ -2237,12 +2242,7 @@ class Feeds extends Handler_Protected { else if ($keyword_value == 'false') $query_keywords[] = "($not (note IS NULL OR note = ''))"; else - /** - * Known issue: when this Keyword is negated like _-note:store_ it only - * selects articles with a note different of "store", but article with no - * notes are not selected (whereas it should also select them). - */ - $query_keywords[] = "($not (LOWER(note) LIKE " . $pdo->quote("%{$keyword_value}%") . '))'; + $query_keywords[] = "($not (LOWER(COALESCE(note, '')) LIKE " . $pdo->quote("%{$keyword_value}%") . '))'; $valid_keyword_processed = true; break; case 'star':