summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Tacklind <cameron@tacklind.com>2015-02-05 14:25:40 -0800
committerCameron Tacklind <cameron@tacklind.com>2015-02-05 14:25:40 -0800
commitdaa1796cf9bbdeb88a5b472c6bac34676fe8d8a9 (patch)
treec6b138ff13e7049bda47f65724d1fa4b7fb06615
parenteb390226749cf23e50fbae614b88533ea660b2e8 (diff)
downloadgitlab-ce-daa1796cf9bbdeb88a5b472c6bac34676fe8d8a9.tar.gz
Be less restrictive on key comment extraction
-rw-r--r--app/views/profiles/keys/new.html.haml6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/profiles/keys/new.html.haml b/app/views/profiles/keys/new.html.haml
index c02b47b0ad5..ccec716d0c6 100644
--- a/app/views/profiles/keys/new.html.haml
+++ b/app/views/profiles/keys/new.html.haml
@@ -8,9 +8,9 @@
$('#key_key').on('focusout', function(){
var title = $('#key_title'),
val = $('#key_key').val(),
- key_mail = val.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+|\.[a-zA-Z0-9._-]+)/gi);
+ comment = val.match(/^\S+ \S+ (.+)$/);
- if( key_mail && key_mail.length > 0 && title.val() == '' ){
- $('#key_title').val( key_mail );
+ if( comment && comment.length > 1 && title.val() == '' ){
+ $('#key_title').val( comment[1] );
}
});