fix #606: HTMLForm constructor read application/x-www-form-urlencoded UTF-8 request body first parameter with BOM in name

This commit is contained in:
Guenter Obiltschnig
2014-11-12 10:33:57 +01:00
parent b2276e7f7e
commit eb8dce47fe
5 changed files with 64 additions and 10 deletions

View File

@@ -160,4 +160,16 @@ std::string& UTF8::toLowerInPlace(std::string& str)
}
void UTF8::removeBOM(std::string& str)
{
if (str.size() >= 3
&& static_cast<unsigned char>(str[0]) == 0xEF
&& static_cast<unsigned char>(str[1]) == 0xBB
&& static_cast<unsigned char>(str[2]) == 0xBF)
{
str.erase(0, 3);
}
}
} // namespace Poco