Trim trailing whitespace from string.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Fri, 6 Apr 2007 12:32:26 +0000 (12:32 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Fri, 6 Apr 2007 12:32:26 +0000 (12:32 +0000)
includes/SearchPostgres.php

index daebfa7..b5ee174 100644 (file)
@@ -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);