Merge pull request #505 from openpgpjs/user_id_formatting
don't allow leading spaces when generating userid
This commit is contained in:
commit
5ffb532f9e
|
@ -391,7 +391,11 @@ function formatUserIds(options) {
|
||||||
if (!util.isString(id.name) || (id.email && !util.isEmailAddress(id.email))) {
|
if (!util.isString(id.name) || (id.email && !util.isEmailAddress(id.email))) {
|
||||||
throw new Error('Invalid user id format');
|
throw new Error('Invalid user id format');
|
||||||
}
|
}
|
||||||
return id.name + ' <' + id.email + '>';
|
id.name = id.name.trim();
|
||||||
|
if (id.name.length > 0) {
|
||||||
|
id.name += ' ';
|
||||||
|
}
|
||||||
|
return id.name + '<' + id.email + '>';
|
||||||
});
|
});
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default {
|
||||||
if (!this.isString(data)) {
|
if (!this.isString(data)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return / </.test(data) && />$/.test(data);
|
return /</.test(data) && />$/.test(data);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user