mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
Separate URL components before percent-decoding
Allow special characters in query string parameters. Closes #9116.
This commit is contained in:
parent
fc534e88a3
commit
b0446380c6
3 changed files with 17 additions and 10 deletions
|
@ -423,10 +423,11 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons
|
|||
const int sepPos = param.indexOf('=');
|
||||
if (sepPos <= 0) continue; // ignores params without name
|
||||
|
||||
const QString paramName {QString::fromUtf8(param.constData(), sepPos)};
|
||||
const int valuePos = sepPos + 1;
|
||||
const QString paramValue {
|
||||
QString::fromUtf8(param.constData() + valuePos, param.size() - valuePos)};
|
||||
const QByteArray nameComponent = midView(param, 0, sepPos);
|
||||
const QByteArray valueComponent = midView(param, (sepPos + 1));
|
||||
|
||||
const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent));
|
||||
const QString paramValue = QString::fromUtf8(QByteArray::fromPercentEncoding(valueComponent));
|
||||
m_params[paramName] = paramValue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue