From 1439ea8976c1ab84bca7213cb4574c8971e006ef Mon Sep 17 00:00:00 2001 From: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:21:40 -0500 Subject: [PATCH] rework iniswap detection to be more robust (#317) also allow for iniswapping within character folder --- core/src/packet/packet_ms.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/packet/packet_ms.cpp b/core/src/packet/packet_ms.cpp index dbdbda2..5dd217f 100644 --- a/core/src/packet/packet_ms.cpp +++ b/core/src/packet/packet_ms.cpp @@ -104,7 +104,8 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const // Selected char is different from supplied folder name // This means the user is INI-swapped if (!area->iniswapAllowed()) { - if (!client.getServer()->getCharacters().contains(l_incoming_args[2].toString(), Qt::CaseInsensitive)) + QStringList l_character_split = l_incoming_args[2].toString().split("/"); + if (!client.getServer()->getCharacters().contains(l_character_split.at(0), Qt::CaseInsensitive) || l_character_split.contains("..")) return l_invalid; } qDebug() << "INI swap detected from " << client.getIpid();