diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-16 21:36:07 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-16 21:36:07 +0000 |
commit | b979bc46743bcb180af93f34b4bb337edce67b7d (patch) | |
tree | 2b419ca64151c0d1887eb77e89a0deee3c134f95 /src/helperfuncs.cpp | |
parent | c28e8dc34a04c1c91b268687e9e0b4146d7c3c3a (diff) |
Validate <server:id> on startup if provided, thx Brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8721 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 309267c38..40b2d7d90 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -506,6 +506,16 @@ bool IsIdentHandler::Call(const char* n) return true; } +bool InspIRCd::IsSID(const std::string &str) +{ + /* Returns true if the string given is exactly 3 characters long, + * starts with a digit, and the other two characters are A-Z or digits + */ + return ((str.length() == 3) && isdigit(str[0]) && + ((str[1] >= 'A' && str[1] <= 'Z') || isdigit(str[1])) && + ((str[2] >= 'A' && str[2] <= 'Z') || isdigit(str[2]))); +} + /* open the proper logfile */ bool InspIRCd::OpenLog(char**, int) { |