Skip to content

Commit

Permalink
Handle hyphens in user dir search porperly
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed May 31, 2024
1 parent 64f5a4a commit aa98846
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions synapse/storage/databases/main/user_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ def _parse_words_with_regex(search_term: str) -> List[str]:
Break down search term into words, when we don't have ICU available.
See: `_parse_words`
"""
return re.findall(r"([\w\-]+)", search_term, re.UNICODE)
return re.findall(r"([\w]+)", search_term, re.UNICODE)


def _parse_words_with_icu(search_term: str) -> List[str]:
Expand Down Expand Up @@ -1309,7 +1309,7 @@ def _parse_words_with_icu(search_term: str) -> List[str]:
# want to include those in results as they would result in syntax errors in SQL
# queries (e.g. "foo bar" would result in the search query including "foo & &
# bar").
if len(re.findall(r"([\w\-]+)", result, re.UNICODE)):
if len(re.findall(r"([\w]+)", result, re.UNICODE)):
results.append(result)

i = j
Expand Down

0 comments on commit aa98846

Please sign in to comment.