Do not crash on & search

This commit is contained in:
Claudio Ortolina
2026-02-27 07:56:44 +00:00
parent 3635e113c8
commit 6bf13486a3
+1 -1
View File
@@ -45,7 +45,7 @@ defmodule MusicLibrary.Records do
defp fts_escape(term) do
# For FTS5, if the term contains special characters, we need to wrap it in double quotes
if String.contains?(term, ["'", " ", "\"", "(", ")", "^", "-", ":", "?", "."]) do
if String.contains?(term, ["'", " ", "\"", "(", ")", "^", "-", ":", "?", ".", "&"]) do
# Escape internal double quotes and wrap in double quotes
escaped = String.replace(term, "\"", "\"\"")
"\"#{escaped}\"*"