Permalink
Browse files

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.
  • Loading branch information...
luccioman committed May 4, 2017
1 parent 4564541 commit 58d23047ddeb9e0ee2aa0bc31ad4692220706cfc
Showing with 1 addition and 2 deletions.
  1. +1 −2 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 static String addBlacklistEntry(
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 + ".*/.*";

0 comments on commit 58d2304

Please sign in to comment.