mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user