mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-31 09:01:56 +01:00
Corrected domain recognition
Domains with hyphens were treates like RegExps. Fixes #244.
This commit is contained in:
parent
aa91a32b68
commit
360c4628ce
@ -29,7 +29,7 @@
|
||||
})
|
||||
.map(function(entry){
|
||||
var regExp;
|
||||
var domain = !!entry.match(/^[\w.]+$/);
|
||||
var domain = !!entry.match(/^[A-Za-z0-9_.-]+$/);
|
||||
if (domain){
|
||||
regExp = new RegExp("(?:^|\\.)" + entry.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "\\.?$", "i");
|
||||
}
|
||||
|
@ -461,7 +461,7 @@
|
||||
urlContainer.on(function({newValue, oldValue}){
|
||||
newValue.forEach(function(urlSetting){
|
||||
var regExp;
|
||||
var domain = !!urlSetting.url.match(/^[\w.]+$/);
|
||||
var domain = !!urlSetting.url.match(/^[A-Za-z0-9_.-]+$/);
|
||||
if (domain){
|
||||
regExp = new RegExp(
|
||||
"(?:^|\\.)" + urlSetting.url.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "\\.?$",
|
||||
|
Loading…
x
Reference in New Issue
Block a user