Escape special characters for like sql searches

This commit is contained in:
emeric
2021-05-02 15:10:32 +02:00
parent a6398738bb
commit 444d4af3c6
27 changed files with 261 additions and 68 deletions
+2 -2
View File
@@ -28,12 +28,12 @@ namespace API::Subsonic
{
std::optional<Id>
IdFromString(const std::string& id)
IdFromString(const std::string_view id)
{
if (id == "root")
return Id {Id::Type::Root};
std::vector<std::string> values {StringUtils::splitString(id, "-")};
std::vector<std::string_view> values {StringUtils::splitString(id, "-")};
if (values.size() != 2)
return std::nullopt;