From 48c3785991f789f34171dfd687b30664c8915a73 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 15 Jan 2013 19:44:21 +0000 Subject: [PATCH] Underscores are allowed in project identifiers (#9225). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11195 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/project_identifier.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;