Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) r 5512 has introduced a bug which resulted in useless filters if site:, filtetype:, or inurl: was used since the filters included the word "null".

low01280e63568608d
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index a50b5fe32..1bcc80282 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -232,7 +232,13 @@ public class yacysearch {
String ft = querystring.substring(filetype + 9, ftb);
query[0].remove("filetype:" + ft.toLowerCase());
while(ft.startsWith(".")) ft = ft.substring(1);
- if(ft.length() > 0) urlmask = urlmask + ".*\\." + ft;
+ if(ft.length() > 0) {
+ if (urlmask == null) {
+ urlmask = ".*\\." + ft;
+ } else {
+ urlmask = urlmask + ".*\\." + ft;
+ }
+ }
}
int site = querystring.indexOf("site:");
if (site >= 0) {
@@ -242,7 +248,13 @@ public class yacysearch {
query[0].remove("site:" + domain.toLowerCase());
while(domain.startsWith(".")) domain = domain.substring(1);
if (domain.indexOf(".") < 0) domain = "\\." + domain; // is tld
- if (domain.length() > 0) urlmask = "[a-zA-Z]*://[^/]*" + domain + "/.*" + urlmask;
+ if (domain.length() > 0) {
+ if (urlmask == null) {
+ urlmask = "[a-zA-Z]*://[^/]*" + domain + "/.*";
+ } else {
+ urlmask = "[a-zA-Z]*://[^/]*" + domain + "/.*" + urlmask;
+ }
+ }
}
if (urlmask == null){
if (post.containsKey("urlmask") && post.get("urlmask").equals("no")) { // option search all