Skip to content

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

fix for link in Supporter and Suftipps page

orbiterf121f4bb4537
diff --git a/htroot/Supporter.java b/htroot/Supporter.java
index 9470e1284..b7310f7f4 100644
--- a/htroot/Supporter.java
+++ b/htroot/Supporter.java
@@ -127,7 +127,7 @@ public class Supporter {
row = Supporter.get(urlhash);
if (row == null) continue;
- url = row.getPrimaryKeyUTF8();
+ url = row.getPrimaryKeyUTF8().trim();
try {
if (Switchboard.urlBlacklist.isListed(Blacklist.BLACKLIST_SURFTIPS, new DigestURI(url, urlhash.getBytes()))) continue;
} catch(final MalformedURLException e) {continue;}
diff --git a/htroot/Surftips.java b/htroot/Surftips.java
index b019494ab..e9339d00e 100644
--- a/htroot/Surftips.java
+++ b/htroot/Surftips.java
@@ -134,7 +134,7 @@ public class Surftips {
row = surftips.get(urlhash);
if (row == null) continue;
- url = row.getPrimaryKeyUTF8();
+ url = row.getPrimaryKeyUTF8().trim();
try{
if(Switchboard.urlBlacklist.isListed(Blacklist.BLACKLIST_SURFTIPS ,new DigestURI(url)))
continue;
diff --git a/source/net/yacy/kelondro/index/Row.java b/source/net/yacy/kelondro/index/Row.java
index b3032857f..b292fa6ef 100644
--- a/source/net/yacy/kelondro/index/Row.java
+++ b/source/net/yacy/kelondro/index/Row.java
@@ -489,6 +489,13 @@ public final class Row {
return c;
}
+ /**
+ * get the utf-8 value of the primary key
+ * you will most likely want to call .trim() on that value if the key does not have a fixed length
+ * because the return value may have a fill-up with zero bytes at the end of the string
+ *
+ * @return
+ */
public final String getPrimaryKeyUTF8() {
if (this.rowinstance[this.offset] == 0) return null;
if (Row.this.row.length == 1 && this.offset == 0 && this.rowinstance.length == Row.this.primaryKeyLength) {