Remove trailing spaces from search string

main
Bob Mottram 2020-08-31 14:50:16 +01:00
parent 1f6a8c02ee
commit 47d68b3c4e
1 changed files with 4 additions and 4 deletions

View File

@ -2196,7 +2196,7 @@ class PubServer(BaseHTTPRequestHandler):
searchStr = searchStr.split('&')[0] searchStr = searchStr.split('&')[0]
searchStr = \ searchStr = \
urllib.parse.unquote_plus(searchStr.strip()) urllib.parse.unquote_plus(searchStr.strip())
searchStr2 = searchStr.lower().strip('\n').strip('\r') searchStr = searchStr.lower().strip()
print('searchStr: ' + searchStr) print('searchStr: ' + searchStr)
if searchForEmoji: if searchForEmoji:
searchStr = ':' + searchStr + ':' searchStr = ':' + searchStr + ':'
@ -2324,11 +2324,11 @@ class PubServer(BaseHTTPRequestHandler):
self.server.POSTbusy = False self.server.POSTbusy = False
return return
elif (searchStr.startswith(':') or elif (searchStr.startswith(':') or
searchStr2.endswith(' emoji')): searchStr.endswith(' emoji')):
# eg. "cat emoji" # eg. "cat emoji"
if searchStr2.endswith(' emoji'): if searchStr.endswith(' emoji'):
searchStr = \ searchStr = \
searchStr2.replace(' emoji', '') searchStr.replace(' emoji', '')
# emoji search # emoji search
emojiStr = \ emojiStr = \
htmlSearchEmoji(self.server.translate, htmlSearchEmoji(self.server.translate,