mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Avoid temporary QString allocations
This fixes clazy warning: Use multi-arg instead [-Wclazy-qstring-arg]
This commit is contained in:
parent
c60b7b213e
commit
0457fd260e
29 changed files with 137 additions and 123 deletions
|
@ -456,7 +456,7 @@ void WebApplication::sendFile(const QString &path)
|
|||
qDebug("File %s was not found!", qUtf8Printable(path));
|
||||
throw NotFoundHTTPError();
|
||||
}
|
||||
|
||||
|
||||
if (file.size() > MAX_ALLOWED_FILESIZE) {
|
||||
qWarning("%s: exceeded the maximum allowed file size!", qUtf8Printable(path));
|
||||
throw InternalServerErrorHTTPError(tr("Exceeded the maximum allowed file size (%1)!")
|
||||
|
@ -579,7 +579,7 @@ bool WebApplication::isAuthNeeded()
|
|||
|
||||
bool WebApplication::isPublicAPI(const QString &scope, const QString &action) const
|
||||
{
|
||||
return m_publicAPIs.contains(QString::fromLatin1("%1/%2").arg(scope).arg(action));
|
||||
return m_publicAPIs.contains(QString::fromLatin1("%1/%2").arg(scope, action));
|
||||
}
|
||||
|
||||
void WebApplication::sessionStart()
|
||||
|
@ -643,7 +643,7 @@ bool WebApplication::isCrossSiteRequest(const Http::Request &request) const
|
|||
const bool isInvalid = !isSameOrigin(urlFromHostHeader(targetOrigin), originValue);
|
||||
if (isInvalid)
|
||||
LogMsg(tr("WebUI: Origin header & Target origin mismatch! Source IP: '%1'. Origin header: '%2'. Target origin: '%3'")
|
||||
.arg(m_env.clientAddress.toString()).arg(originValue).arg(targetOrigin)
|
||||
.arg(m_env.clientAddress.toString(), originValue, targetOrigin)
|
||||
, Log::WARNING);
|
||||
return isInvalid;
|
||||
}
|
||||
|
@ -652,7 +652,7 @@ bool WebApplication::isCrossSiteRequest(const Http::Request &request) const
|
|||
const bool isInvalid = !isSameOrigin(urlFromHostHeader(targetOrigin), refererValue);
|
||||
if (isInvalid)
|
||||
LogMsg(tr("WebUI: Referer header & Target origin mismatch! Source IP: '%1'. Referer header: '%2'. Target origin: '%3'")
|
||||
.arg(m_env.clientAddress.toString()).arg(refererValue).arg(targetOrigin)
|
||||
.arg(m_env.clientAddress.toString(), refererValue, targetOrigin)
|
||||
, Log::WARNING);
|
||||
return isInvalid;
|
||||
}
|
||||
|
@ -701,7 +701,7 @@ bool WebApplication::validateHostHeader(const QStringList &domains) const
|
|||
}
|
||||
|
||||
LogMsg(tr("WebUI: Invalid Host header. Request source IP: '%1'. Received Host header: '%2'")
|
||||
.arg(m_env.clientAddress.toString()).arg(m_request.headers[Http::HEADER_HOST])
|
||||
.arg(m_env.clientAddress.toString(), m_request.headers[Http::HEADER_HOST])
|
||||
, Log::WARNING);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue