1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-27 17:18:04 +01:00

catch invalid regex

This commit is contained in:
Kyle Spearrin 2018-05-30 23:19:12 -04:00
parent 2c43a5f06a
commit e0190f14be

View File

@ -238,10 +238,12 @@ export class CipherService implements CipherServiceAbstraction {
} }
break; break;
case UriMatchType.RegularExpression: case UriMatchType.RegularExpression:
const regex = new RegExp(u.uri, 'i'); try {
if (regex.test(url)) { const regex = new RegExp(u.uri, 'i');
return true; if (regex.test(url)) {
} return true;
}
} catch { }
break; break;
case UriMatchType.Never: case UriMatchType.Never:
default: default: