diff --git a/assets/js/helpers/contains.js b/assets/js/helpers/contains.js index cd9c53f..d40f1b2 100644 --- a/assets/js/helpers/contains.js +++ b/assets/js/helpers/contains.js @@ -17,8 +17,10 @@ function contains(url, list) { // If by any chance one line in the list is empty, ignore it if(cleanLine === '') continue; - // If url contains the current line return true - if (url.indexOf(cleanLine) > -1) { + var lineRe = new RegExp(cleanLine.replace('.', '\.').replace('*', '.*')); + + // If url matches the current line return true + if (lineRe.test(url)) { return true; } }