mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
More fixes for scrutinizer-ci
This commit is contained in:
parent
c7e97b78d6
commit
59b32241bf
16 changed files with 116 additions and 191 deletions
|
|
@ -30,27 +30,29 @@ function AddOpenPgpKeyPopupView()
|
|||
|
||||
var
|
||||
count = 30,
|
||||
match = null,
|
||||
key = Utils.trim(this.key()),
|
||||
keyTrimmed = Utils.trim(this.key()),
|
||||
reg = /[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,
|
||||
openpgpKeyring = PgpStore.openpgpKeyring,
|
||||
done = false;
|
||||
openpgpKeyring = PgpStore.openpgpKeyring;
|
||||
|
||||
if (/[\n]/.test(key))
|
||||
if (/[\n]/.test(keyTrimmed))
|
||||
{
|
||||
key = key.replace(/[\r]+/g, '').replace(/[\n]{2,}/g, '\n\n');
|
||||
keyTrimmed = keyTrimmed.replace(/[\r]+/g, '').replace(/[\n]{2,}/g, '\n\n');
|
||||
}
|
||||
|
||||
this.key.error('' === key);
|
||||
this.key.error('' === keyTrimmed);
|
||||
|
||||
if (!openpgpKeyring || this.key.error())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var
|
||||
done = false,
|
||||
match = null;
|
||||
|
||||
do
|
||||
{
|
||||
match = reg.exec(key);
|
||||
match = reg.exec(keyTrimmed);
|
||||
if (match && 0 < count)
|
||||
{
|
||||
if (match[0] && match[1] && match[2] && match[1] === match[2])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue