From 1f6b9d308650b702cdfe49b7540bef4b3a4fc9f9 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Tue, 13 Oct 2015 15:33:22 +0200 Subject: Correctly escape ClientInfo and ScenarioSettings --- src/crsm.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/crsm.hpp') diff --git a/src/crsm.hpp b/src/crsm.hpp index cdce0d1..3e11054 100644 --- a/src/crsm.hpp +++ b/src/crsm.hpp @@ -65,8 +65,8 @@ public: void setValue(const QString& val) { - QStringList parts = val.split(':', QString::KeepEmptyParts); - if(parts.length() < 3) + QStringList parts = Util::splitEscaped(val, ':', '|'); + if(parts.length() != 3) { throw ConfigException("Cannot read corrupt ScenarioSettings"); } @@ -77,11 +77,11 @@ public: config.league = ConfigValueBase::getValue(parts.first()); parts.removeFirst(); config.randomLeague = false; - config.wishClient = ConfigValueBase::getValue(parts.join(':')); + config.wishClient = ConfigValueBase::getValue(parts.first()); } } - QString value() { return ConfigValueBase::getStringValue(config.name) + ":" + ConfigValueBase::getStringValue(config.league) + ":" + ConfigValueBase::getStringValue(config.wishClient); } + QString value() { return Util::joinEscape({ConfigValueBase::getStringValue(config.name), ConfigValueBase::getStringValue(config.league), ConfigValueBase::getStringValue(config.wishClient)}, ':', '|'); } }; class CRSM : public QObject -- cgit v1.2.3-54-g00ecf