[#1794] Fixed search query splitting regex to deal with Unicode. Adjusted a test.

This commit is contained in:
Ivan Tashkinov 2020-05-30 10:29:08 +03:00
commit 24f40b8a26
2 changed files with 5 additions and 1 deletions

View file

@ -124,7 +124,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
defp prepare_tags(query, add_joined_tag \\ true) do
tags =
query
|> String.split(~r/[^#\w]+/, trim: true)
|> String.split(~r/[^#\w]+/u, trim: true)
|> Enum.uniq_by(&String.downcase/1)
explicit_tags = Enum.filter(tags, fn tag -> String.starts_with?(tag, "#") end)