X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/b8b12bb5a66007f2703e4dc3c18f34439d66d1c4..a04dc488f5fea78a2a51bde4b59b4aad50cf3204:/src/search/views.py diff --git a/src/search/views.py b/src/search/views.py index 67c3fd48f..5b65a3006 100644 --- a/src/search/views.py +++ b/src/search/views.py @@ -132,6 +132,10 @@ def hint(request): @cache.never_cache def main(request): query = request.GET.get('q', '') + query = ' '.join(query.split()) + # filter out private use characters + import unicodedata + query = ''.join(ch for ch in query if unicodedata.category(ch) != 'Co') if len(query) < 2: return render_to_response(