summaryrefslogtreecommitdiff
path: root/src/playerrelations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/playerrelations.cpp')
-rw-r--r--src/playerrelations.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp
index 1bf63aa81..81338de74 100644
--- a/src/playerrelations.cpp
+++ b/src/playerrelations.cpp
@@ -574,14 +574,24 @@ bool PlayerRelationsManager::checkName(const std::string &name) const
const int size = name.size();
std::string check = config.getStringValue("unsecureChars");
- if (name.substr(0, 1) == " " || name.substr(size - 1, 1) == " ")
+ std::string lastChar = name.substr(size - 1, 1);
+ if (name.substr(0, 1) == " " || lastChar == " " || lastChar == "."
+ || name.find(" ") != std::string::npos)
+ {
return false;
+ }
else if (check.empty())
+ {
return true;
+ }
else if (name.find_first_of(check) != std::string::npos)
+ {
return false;
+ }
else
+ {
return true;
+ }
}
PlayerRelationsManager player_relations;