From d046c0b3b3e4e25973b6b403bde3c6057d3c2e03 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Fri, 6 Apr 2007 12:32:26 +0000 Subject: [PATCH] Trim trailing whitespace from string. --- includes/SearchPostgres.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/SearchPostgres.php b/includes/SearchPostgres.php index daebfa7130..b5ee174bc0 100644 --- a/includes/SearchPostgres.php +++ b/includes/SearchPostgres.php @@ -98,6 +98,9 @@ class SearchPostgres extends SearchEngine { ## Remove any non-spaced operators (e.g. "Zounds!") $searchstring = preg_replace('/([^ ])[\!\&\|]/', "$1", $searchstring); + ## Remove any trailing whitespace + $searchstring = preg_replace('/\s+$/', '', $searchstring); + ## Remove any trailing operators $searchstring = preg_replace('/(?: [\!\&\|])*$/', '', $searchstring); -- 2.20.1