From 2d01411bbc9863fd4d5c69d5bcf2adab1b099a4f Mon Sep 17 00:00:00 2001 From: low012 Date: Sat, 26 Sep 2009 21:33:33 +0000 Subject: [PATCH] *) tested string will appear in input box now (when testing a similar URL it does need to be copied anymore, it can be edited it right away) *) https:// and ftp:// can be used as start of the string to be tested now too *) better error handling (no text in Java anymore) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6347 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/BlacklistTest_p.html | 6 +++++- htroot/BlacklistTest_p.java | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/htroot/BlacklistTest_p.html b/htroot/BlacklistTest_p.html index 48eddc8c2..593768596 100644 --- a/htroot/BlacklistTest_p.html +++ b/htroot/BlacklistTest_p.html @@ -14,10 +14,11 @@
Test list:
-   +   #(testlist)#:: +

The tested URL was #[url]#
It is blocked for the following cases:
@@ -30,6 +31,9 @@ #(listedinsurftips)#::
  • Surftips
  • #(/listedinsurftips)#
    + :: +

    +
    The tested URL was not valid.
    #(/testlist)#
    diff --git a/htroot/BlacklistTest_p.java b/htroot/BlacklistTest_p.java index 3e6051be7..606e1ee41 100644 --- a/htroot/BlacklistTest_p.java +++ b/htroot/BlacklistTest_p.java @@ -55,12 +55,16 @@ public class BlacklistTest_p { if(post != null && post.containsKey("testList")) { prop.put("testlist", "1"); String urlstring = post.get("testurl", ""); - if(!urlstring.startsWith("http://")) urlstring = "http://"+urlstring; + if(!urlstring.startsWith("http://") && + !urlstring.startsWith("https://")&& + !urlstring.startsWith("ftp://") + ) urlstring = "http://"+urlstring; yacyURL testurl = null; try { testurl = new yacyURL(urlstring, null); } catch (final MalformedURLException e) { testurl = null; } if(testurl != null) { + prop.putHTML("url",testurl.toString()); prop.putHTML("testlist_url",testurl.toString()); if(Switchboard.urlBlacklist.isListed(Blacklist.BLACKLIST_CRAWLER, testurl)) prop.put("testlist_listedincrawler", "1"); @@ -75,7 +79,12 @@ public class BlacklistTest_p { if(Switchboard.urlBlacklist.isListed(Blacklist.BLACKLIST_SURFTIPS, testurl)) prop.put("testlist_listedinsurftips", "1"); } - else prop.put("testlist_url","not valid"); + else { + prop.putHTML("url",urlstring); + prop.put("testlist", "2"); + } + } else { + prop.putHTML("url", "http://"); } return prop; }