comparison OrthancServer/Sources/OrthancConfiguration.cpp @ 4164:b3c5418109a9

underscores are now allowed in peers/modalities symbolic names
author Alain Mazy <alain@mazy.be>
date Mon, 24 Aug 2020 15:34:11 +0200
parents 0ddc5297a8ab
children 1c9c2c41c015
comparison
equal deleted inserted replaced
4163:d0f9e29a751b 4164:b3c5418109a9
179 static void CheckAlphanumeric(const std::string& s) 179 static void CheckAlphanumeric(const std::string& s)
180 { 180 {
181 for (size_t j = 0; j < s.size(); j++) 181 for (size_t j = 0; j < s.size(); j++)
182 { 182 {
183 if (!isalnum(s[j]) && 183 if (!isalnum(s[j]) &&
184 s[j] != '-') 184 s[j] != '-' && s[j] != '_')
185 { 185 {
186 throw OrthancException(ErrorCode_BadFileFormat, 186 throw OrthancException(ErrorCode_BadFileFormat,
187 "Only alphanumeric and dash characters are allowed " 187 "Only alphanumeric, dash characters and underscores are allowed "
188 "in the names of modalities/peers, but found: " + s); 188 "in the names of modalities/peers, but found: " + s);
189 } 189 }
190 } 190 }
191 } 191 }
192 192