rework iniswap detection to be more robust (#317)

also allow for iniswapping within character folder
This commit is contained in:
Rosemary Witchaven 2022-08-11 09:21:40 -05:00 committed by GitHub
parent 81da1db622
commit 1439ea8976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();