From f121f4bb4537ab81d2331866f72d821127cfa36e Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 1 Nov 2011 22:49:14 +0000 Subject: [PATCH] fix for link in Supporter and Suftipps page git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8010 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Supporter.java | 2 +- htroot/Surftips.java | 2 +- source/net/yacy/kelondro/index/Row.java | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) 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) {