mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
only allow a-z A-Z 0-9 - _ [ ] # as channel name characters
This commit is contained in:
committed by
Dennis Klein
parent
7bea2bc0e6
commit
3db32b03d4
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <boost/algorithm/string.hpp> // join/split
|
||||
|
||||
#include <regex>
|
||||
#include <set>
|
||||
#include <random>
|
||||
|
||||
@@ -480,9 +481,11 @@ try {
|
||||
}
|
||||
|
||||
// validate channel name
|
||||
if (fName.find(".") != string::npos) {
|
||||
smatch m;
|
||||
if (regex_search(fName, m, regex("[^a-zA-Z0-9\\-_\\[\\]#]"))) {
|
||||
ss << "INVALID";
|
||||
LOG(error) << "channel name must not contain '.'";
|
||||
LOG(debug) << ss.str();
|
||||
LOG(error) << "channel name contains illegal character: '" << m.str(0) << "', allowed characters are: a-z, A-Z, 0-9, -, _, [, ], #";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user