FIX: Do not wrap unaccent around tsqueries (#16284)

tsqueries use quotes and having other characters that when unaccented
become quotes results in invalid tsqueries.
This commit is contained in:
Bianca Nenciu
2022-03-25 19:10:05 +02:00
committed by GitHub
parent 96719cbf4f
commit 6eb3d658ca
2 changed files with 17 additions and 3 deletions

View File

@ -580,6 +580,11 @@ describe Topic do
end
end
it 'does not result in a syntax error when removing accents' do
SiteSetting.search_ignore_accents = true
expect(Topic.similar_to('something', "it's")).to eq([])
end
it 'does not result in a syntax error when raw is blank after cooking' do
expect(Topic.similar_to('some title', '#')).to eq([])
end