Underscores are allowed in project identifiers (#9225).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11195 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-01-15 19:44:21 +00:00
parent 04ab2f2458
commit 48c3785991
1 changed files with 2 additions and 2 deletions

View File

@ -51,8 +51,8 @@ function generateProjectIdentifier(identifier, maxlength) {
for(var i=0; i<diacriticsMap.length; i++) { for(var i=0; i<diacriticsMap.length; i++) {
identifier = identifier.replace(diacriticsMap[i].letters, diacriticsMap[i].base); identifier = identifier.replace(diacriticsMap[i].letters, diacriticsMap[i].base);
} }
identifier = identifier.replace(/[^a-z0-9]+/gi, '-'); // remaining non-alphanumeric => hyphen identifier = identifier.replace(/[^a-z0-9_]+/gi, '-'); // remaining non-alphanumeric => hyphen
identifier = identifier.replace(/^[-\d]*|-*$/g, ''); // remove hyphens and numbers at beginning and hyphens at end identifier = identifier.replace(/^[-_\d]*|[-_]*$/g, ''); // remove hyphens/underscores and numbers at beginning and hyphens/underscores at end
identifier = identifier.toLowerCase(); // to lower identifier = identifier.toLowerCase(); // to lower
identifier = identifier.substr(0, maxlength); // max characters identifier = identifier.substr(0, maxlength); // max characters
return identifier; return identifier;