diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-08 01:07:23 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-08 01:07:23 -0800 |
commit | fa3a7ef0379ec67706a8923a68dec99082a0face (patch) | |
tree | 6759f779ebd3b939181590f2970c6592843cfe75 /app | |
parent | 8c12c93e07c536940fc63bf3c5ae824e96d43661 (diff) | |
parent | daa1796cf9bbdeb88a5b472c6bac34676fe8d8a9 (diff) | |
download | gitlab-ce-fa3a7ef0379ec67706a8923a68dec99082a0face.tar.gz |
Merge pull request #8740 from cinderblock/master
Be less restrictive on key comment extraction
Diffstat (limited to 'app')
-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] ); } }); |