aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/dcc/requests.cpp
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-05-14 13:49:51 +0000
committerGravatar Fabio Bas2010-05-14 13:49:51 +0000
commitf92c7d6e3b847d502e40bc0578d830d4919f09e4 (patch)
tree5818ed8f6fed117219da997370c9bf8ff3ccb0b2 /src/modules/dcc/requests.cpp
parentSome fixes in classeditor (diff)
downloadKVIrc-f92c7d6e3b847d502e40bc0578d830d4919f09e4.tar.gz
KVIrc-f92c7d6e3b847d502e40bc0578d830d4919f09e4.tar.bz2
KVIrc-f92c7d6e3b847d502e40bc0578d830d4919f09e4.zip
Merge the use of multiple QString()::arg(QString) calls to avoid format strings
Filter out any urlencoded path form dcc file names git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4317 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dcc/requests.cpp')
-rw-r--r--src/modules/dcc/requests.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/modules/dcc/requests.cpp b/src/modules/dcc/requests.cpp
index 0ba8569a8..88d6fe968 100644
--- a/src/modules/dcc/requests.cpp
+++ b/src/modules/dcc/requests.cpp
@@ -85,7 +85,7 @@ static void dcc_module_request_error(KviDccRequest * dcc,const QString& errText)
if(KVI_OPTION_BOOL(KviOption_boolNotifyFailedDccHandshakes))
{
- QString szError = QString("Sorry, your DCC %1 request can't be satisfied: %2").arg(dcc->szType.ptr()).arg(errText);
+ QString szError = QString("Sorry, your DCC %1 request can't be satisfied: %2").arg(dcc->szType.ptr(), errText);
dcc_module_reply_errmsg(dcc,szError);
}
}
@@ -464,6 +464,16 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
dcc->szParam1.cutToLast('/');
}
+ if(dcc->szParam1.contains("%2F"))
+ {
+ if(!dcc->ctcpMsg->msg->haltOutput())
+ {
+ dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
+ __tr2qs_ctx("The above request is broken: The filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr());
+ }
+ dcc->szParam1.cutToLast("%2F");
+ }
+
KviStr szExtensions = dcc->szType;
szExtensions.cutRight(4); // cut off SEND