From b979bc46743bcb180af93f34b4bb337edce67b7d Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 16 Jan 2008 21:36:07 +0000 Subject: Validate on startup if provided, thx Brain git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8721 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/helperfuncs.cpp') 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) { -- cgit v1.3.1-10-gc9f91