diff options
author | Cameron Tacklind <cameron@tacklind.com> | 2015-02-05 14:25:40 -0800 |
---|---|---|
committer | Cameron Tacklind <cameron@tacklind.com> | 2015-02-05 14:25:40 -0800 |
commit | daa1796cf9bbdeb88a5b472c6bac34676fe8d8a9 (patch) | |
tree | c6b138ff13e7049bda47f65724d1fa4b7fb06615 | |
parent | eb390226749cf23e50fbae614b88533ea660b2e8 (diff) | |
download | gitlab-ce-daa1796cf9bbdeb88a5b472c6bac34676fe8d8a9.tar.gz |
Be less restrictive on key comment extraction
-rw-r--r-- | app/views/profiles/keys/new.html.haml | 6 |
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] ); } }); |