[ion] Storage: make Storage::nameCompliant less restrictive (accepts

.*\.[a-z]+). But Script::nameCompliant is stricted: [a-z_0-9.]*
This commit is contained in:
Émilie Feral
2018-09-13 11:07:16 +02:00
parent 51341f4abe
commit 08077cb141
6 changed files with 24 additions and 11 deletions

View File

@@ -25,4 +25,17 @@ const char * Script::readContent() const {
return (const char *)d.buffer+k_importationStatusSize;
}
bool Script::nameCompliant(const char * name) {
/* The name format is [a-z0-9_.]* */
const char * currentChar = name;
while (*currentChar != 0) {
if ((*currentChar >= 'a' && *currentChar <= 'z') || *currentChar == '_' || (*currentChar >= '0' && *currentChar <= '9') || *currentChar == '.') {
currentChar++;
continue;
}
return false;
}
return name != currentChar;
}
}