diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-08-27 17:24:48 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-08-27 17:26:08 (GMT) |
commit | 6137a266fd5f8d5953f7fa4baeee339d27f0caee (patch) | |
tree | a553176ffe9a786db2531346fdf8005333b1262a /Swiften/JID/JID.cpp | |
parent | fd86fb8f38343e0eda229cd857ef03ed5c8a34e4 (diff) | |
download | swift-contrib-6137a266fd5f8d5953f7fa4baeee339d27f0caee.zip swift-contrib-6137a266fd5f8d5953f7fa4baeee339d27f0caee.tar.bz2 |
Mark JIDs with empty domains as invalid when StringPrep cache is disabled.
We used to only do this correctly in the default compilation setting
where the cache is enabled.
Resolves: #965
Diffstat (limited to 'Swiften/JID/JID.cpp')
-rw-r--r-- | Swiften/JID/JID.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Swiften/JID/JID.cpp b/Swiften/JID/JID.cpp index 925c763..f121120 100644 --- a/Swiften/JID/JID.cpp +++ b/Swiften/JID/JID.cpp @@ -92,10 +92,6 @@ void JID::nameprepAndSetComponents(const std::string& node, const std::string& d r.first->second = StringPrep::getPrepared(domain, StringPrep::XMPPNodePrep); } domain_ = r.first->second; - if (domain_.empty()) { - valid_ = false; - return; - } r = resourcePrepCache.insert(std::make_pair(resource, std::string())); if (r.second) { @@ -103,6 +99,11 @@ void JID::nameprepAndSetComponents(const std::string& node, const std::string& d } resource_ = r.first->second; #endif + + if (domain_.empty()) { + valid_ = false; + return; + } } catch (const std::exception&) { valid_ = false; |