diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-09 07:35:48 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-09 07:35:48 +0000 |
commit | 3a3fe668c77cdb3266bfd1b067a30a1c09713763 (patch) | |
tree | 87a5e51ad877bff7e4c0195073f1435f5f1be0ed /lib/redmine | |
parent | 85866cdcf30dc130f31ac65c3e3e694c58be6cfa (diff) | |
download | redmine-3a3fe668c77cdb3266bfd1b067a30a1c09713763.tar.gz redmine-3a3fe668c77cdb3266bfd1b067a30a1c09713763.zip |
Fix tokenization of phrases with non-ascii chars (#20730).
Patch by Jens Krämer.
git-svn-id: http://svn.redmine.org/redmine/trunk@14662 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/search.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/redmine/search.rb b/lib/redmine/search.rb index 54eab7745..99795a0d1 100644 --- a/lib/redmine/search.rb +++ b/lib/redmine/search.rb @@ -58,7 +58,7 @@ module Redmine # extract tokens from the question # eg. hello "bye bye" => ["hello", "bye bye"] - @tokens = @question.scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)}).collect {|m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '')} + @tokens = @question.scan(%r{((\s|^)"[^"]+"(\s|$)|\S+)}).collect {|m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '')} # tokens must be at least 2 characters long @tokens = @tokens.uniq.select {|w| w.length > 1 } # no more than 5 tokens to search for |