From 368d8cae39e1f4192d6921d15bcdc3e8b21a05f2 Mon Sep 17 00:00:00 2001 From: crs Date: Wed, 16 Apr 2003 20:05:00 +0000 Subject: [PATCH] Now allowing screen names with underscores. --- lib/server/CConfig.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/server/CConfig.cpp b/lib/server/CConfig.cpp index b9024d6b..f75193a2 100644 --- a/lib/server/CConfig.cpp +++ b/lib/server/CConfig.cpp @@ -318,7 +318,7 @@ bool CConfig::isValidScreenName(const CString& name) const { // name is valid if matches validname - // name ::= [A-Za-z0-9] | [A-Za-z0-9][-A-Za-z0-9]*[A-Za-z0-9] + // name ::= [_A-Za-z0-9] | [_A-Za-z0-9][-_A-Za-z0-9]*[_A-Za-z0-9] // domain ::= . name // validname ::= name domain* @@ -337,13 +337,14 @@ CConfig::isValidScreenName(const CString& name) const } // check first and last characters - if (!isalnum(name[b]) || !isalnum(name[e - 1])) { + if (!(isalnum(name[b]) || name[b] == '_') || + !(isalnum(name[e - 1]) || name[e - 1] == '_')) { return false; } // check interior characters for (CString::size_type i = b; i < e; ++i) { - if (!isalnum(name[i]) && name[i] != '-') { + if (!isalnum(name[i]) && name[i] != '_' && name[i] != '-') { return false; } }