diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-03-07 09:52:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 09:52:21 +0100 |
commit | 3c5b2651ad10bc486027b91b915c3b89228f5a09 (patch) | |
tree | f6d2af56e795a5673b75afc812d934bf757e5ebf | |
parent | 4eb3145594d4055e24d04bb37003013750b5688e (diff) | |
parent | ea91864ab979409ef8a7097252d9305832527b9a (diff) |
Merge pull request #510 from nextcloud/overwrite-vcards-uid
MD5 invalid uids
-rw-r--r-- | js/models/contact_model.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/js/models/contact_model.js b/js/models/contact_model.js index 1adc88be..9bc1351f 100644 --- a/js/models/contact_model.js +++ b/js/models/contact_model.js @@ -1,5 +1,5 @@ angular.module('contactsApp') -.factory('Contact', function($filter, MimeService) { +.factory('Contact', function($filter, MimeService, uuid4) { return function Contact(addressBook, vCard) { angular.extend(this, { @@ -28,7 +28,9 @@ angular.module('contactsApp') return model.setProperty('uid', { value: value }); } else { // getter - return model.getProperty('uid').value; + var uid = model.getProperty('uid').value; + /* global md5 */ + return uuid4.validate(uid) ? uid : md5(uid); } }, |