From 58d23047ddeb9e0ee2aa0bc31ad4692220706cfc Mon Sep 17 00:00:00 2001 From: luccioman Date: Thu, 4 May 2017 11:19:59 +0200 Subject: [PATCH] Handle '?' and '+' chars as valid wild cards when adding to blacklist. An entry such as "domain.com/[a-z]+" is a valid regular expression and do not need additional ".*.*/.*" wildcards. --- source/net/yacy/repository/BlacklistHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/net/yacy/repository/BlacklistHelper.java b/source/net/yacy/repository/BlacklistHelper.java index 976088e02..dd57a1ee8 100644 --- a/source/net/yacy/repository/BlacklistHelper.java +++ b/source/net/yacy/repository/BlacklistHelper.java @@ -1,7 +1,6 @@ package net.yacy.repository; import net.yacy.cora.document.id.Punycode.PunycodeException; -import net.yacy.cora.protocol.HeaderFramework; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.util.ConcurrentLog; import net.yacy.data.ListManager; @@ -53,7 +52,7 @@ public final class BlacklistHelper { newEntry = newEntry.substring(8); } - if (newEntry.indexOf("*") < 0) { + if (newEntry.indexOf("*") < 0 && newEntry.indexOf("?") < 0 && newEntry.indexOf("+") < 0) { // user did not use any wild cards and just submitted a word newEntry = ".*" + newEntry + ".*/.*";