diff --git a/public/javascripts/project_identifier.js b/public/javascripts/project_identifier.js index bfbce3cbe..298ca38f2 100644 --- a/public/javascripts/project_identifier.js +++ b/public/javascripts/project_identifier.js @@ -51,8 +51,8 @@ function generateProjectIdentifier(identifier, maxlength) { for(var i=0; i hyphen - identifier = identifier.replace(/^[-\d]*|-*$/g, ''); // remove hyphens and numbers at beginning and hyphens at end + identifier = identifier.replace(/[^a-z0-9_]+/gi, '-'); // remaining non-alphanumeric => hyphen + identifier = identifier.replace(/^[-_\d]*|[-_]*$/g, ''); // remove hyphens/underscores and numbers at beginning and hyphens/underscores at end identifier = identifier.toLowerCase(); // to lower identifier = identifier.substr(0, maxlength); // max characters return identifier;