1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-30 19:46:56 +00:00

fix: potentially incorrect error message in rpc-server whitelist (#4264)

Fixes #928.
This commit is contained in:
Charles Kerr 2022-11-28 15:46:30 -06:00 committed by GitHub
parent 735ea201ea
commit af9f1b4e42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -807,18 +807,8 @@ static auto parseWhitelist(std::string_view whitelist)
auto const pos = whitelist.find_first_of(" ,;"sv); auto const pos = whitelist.find_first_of(" ,;"sv);
auto const token = tr_strvStrip(whitelist.substr(0, pos)); auto const token = tr_strvStrip(whitelist.substr(0, pos));
list.emplace_back(token); list.emplace_back(token);
tr_logAddInfo(fmt::format(_("Added '{entry}' to host whitelist"), fmt::arg("entry", token)));
whitelist = pos == std::string_view::npos ? ""sv : whitelist.substr(pos + 1); whitelist = pos == std::string_view::npos ? ""sv : whitelist.substr(pos + 1);
if (token.find_first_of("+-"sv) != std::string_view::npos)
{
tr_logAddWarn(fmt::format(
_("Added '{entry}' to host whitelist and it has a '+' or '-'! Are you using an old ACL by mistake?"),
fmt::arg("entry", token)));
}
else
{
tr_logAddInfo(fmt::format(_("Added '{entry}' to host whitelist"), fmt::arg("entry", token)));
}
} }
return list; return list;