From 511dcbb17280402873837d61eeb72699477bfd8c Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 23 Jul 2007 00:50:57 +0000 Subject: [PATCH] fixed encoding bug made in SVN 3993 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3998 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/BlacklistCleaner_p.java | 4 +- htroot/htdocsdefault/dir.java | 12 +-- htroot/xml/blacklists_p.java | 2 +- htroot/xml/bookmarks/posts/all.java | 14 +-- htroot/xml/bookmarks/posts/get.java | 14 +-- htroot/xml/queues_p.java | 14 +-- htroot/xml/snippet.java | 2 +- htroot/xml/util/getpageinfo_p.java | 4 +- source/de/anomic/server/serverObjects.java | 10 +- source/de/anomic/yacy/yacyClient.java | 110 ++++++++++----------- 10 files changed, 89 insertions(+), 97 deletions(-) diff --git a/htroot/BlacklistCleaner_p.java b/htroot/BlacklistCleaner_p.java index 512f0560a..d75ad72e8 100644 --- a/htroot/BlacklistCleaner_p.java +++ b/htroot/BlacklistCleaner_p.java @@ -129,7 +129,7 @@ public class BlacklistCleaner_p { // list illegal entries HashMap ies = getIllegalEntries(blacklistToUse, supportedBlacklistTypes, plasmaSwitchboard.urlBlacklist); prop.put(RESULTS + "entries", ies.size()); - prop.putSafeXML(RESULTS + "blEngine", plasmaSwitchboard.urlBlacklist.getEngineInfo()); + prop.put(RESULTS + "blEngine", plasmaSwitchboard.urlBlacklist.getEngineInfo()); prop.put(RESULTS + "disabled", (ies.size() == 0) ? 1 : 0); if (ies.size() > 0) { prop.put(RESULTS + DISABLED + "entries", ies.size()); @@ -139,7 +139,7 @@ public class BlacklistCleaner_p { while (it.hasNext()) { s = (String)it.next(); prop.put(RESULTS + DISABLED + ENTRIES + i + "_error", ((Integer)ies.get(s)).longValue()); - prop.putSafeXML(RESULTS + DISABLED + ENTRIES + i + "_entry", s); + prop.put(RESULTS + DISABLED + ENTRIES + i + "_entry", s); i++; } } diff --git a/htroot/htdocsdefault/dir.java b/htroot/htdocsdefault/dir.java index def69100a..01acb523c 100644 --- a/htroot/htdocsdefault/dir.java +++ b/htroot/htdocsdefault/dir.java @@ -238,7 +238,7 @@ public class dir { // tree += "path = " + path + "

"; if (list != null) { int filecount = 0, fileIdx = 0; - prop.putSafeXML("path", path); + prop.put("path", path); boolean dark = false; for (int i = 0; i < list.length; i++) { @@ -283,12 +283,12 @@ public class dir { prop.put("dirlist_" + fileIdx + "_dir_rfc822date" , httpc.dateString(new Date(f.lastModified()))); prop.put("dirlist_" + fileIdx + "_dir_timestamp" , Long.toString(f.lastModified())); // the entry name - prop.putSafeXML("dirlist_" + fileIdx + "_dir_name" , fileName); + prop.put("dirlist_" + fileIdx + "_dir_name" , fileName); if (f.isDirectory()) { // the entry is a directory prop.put("dirlist_" + fileIdx + "_dir" , 1); - prop.putSafeXML("dirlist_" + fileIdx + "_dir_URL","http://" + yacyCore.seedDB.mySeed.getPublicAddress() + path + fileName + "/"); + prop.put("dirlist_" + fileIdx + "_dir_URL","http://" + yacyCore.seedDB.mySeed.getPublicAddress() + path + fileName + "/"); } else { // determine if we should display the description string or a preview image boolean showImage = /* (description.length() == 0) && */ (fileName.endsWith(".jpg") || fileName.endsWith(".gif") || fileName.endsWith(".png") || fileName.endsWith(".ico") || fileName.endsWith(".bmp")); @@ -299,8 +299,8 @@ public class dir { prop.put("dirlist_" + fileIdx + "_dir_size" , serverMemory.bytesToString(f.length())); prop.put("dirlist_" + fileIdx + "_dir_sizeBytes" , Long.toString(f.length())); // the unique url - prop.putSafeXML("dirlist_" + fileIdx + "_dir_yacyhURL",yacyhURL(yacyCore.seedDB.mySeed, fileName, md5s)); - prop.putSafeXML("dirlist_" + fileIdx + "_dir_URL","http://" + yacyCore.seedDB.mySeed.getPublicAddress() + path + fileName); + prop.put("dirlist_" + fileIdx + "_dir_yacyhURL",yacyhURL(yacyCore.seedDB.mySeed, fileName, md5s)); + prop.put("dirlist_" + fileIdx + "_dir_URL","http://" + yacyCore.seedDB.mySeed.getPublicAddress() + path + fileName); // the md5 sum of the file prop.put("dirlist_" + fileIdx + "_dir_md5s",md5s); // description mode: 0...image preview, 1...description text @@ -309,7 +309,7 @@ public class dir { prop.put("dirlist_" + fileIdx + "_dir_descriptionMode_image",fileName); } // always set the description tag (needed by rss and xml) - prop.putSafeXML("dirlist_" + fileIdx + "_dir_descriptionMode_text",description); + prop.put("dirlist_" + fileIdx + "_dir_descriptionMode_text",description); } prop.put("dirlist_" + fileIdx + "_adminAuthorization",adminAuthorization?1:0); diff --git a/htroot/xml/blacklists_p.java b/htroot/xml/blacklists_p.java index 9ece85718..a2a7660e3 100644 --- a/htroot/xml/blacklists_p.java +++ b/htroot/xml/blacklists_p.java @@ -67,7 +67,7 @@ public class blacklists_p { if (nextEntry.length() == 0) continue; if (nextEntry.startsWith("#")) continue; - prop.putSafeXML("lists_" + blacklistCount + "_items_" + count + "_item", nextEntry); + prop.put("lists_" + blacklistCount + "_items_" + count + "_item", nextEntry); count++; } prop.put("lists_" + blacklistCount + "_items", count); diff --git a/htroot/xml/bookmarks/posts/all.java b/htroot/xml/bookmarks/posts/all.java index 0a913880b..540ed3dcd 100644 --- a/htroot/xml/bookmarks/posts/all.java +++ b/htroot/xml/bookmarks/posts/all.java @@ -78,18 +78,18 @@ public class all { Date date; while(it.hasNext()){ bookmark=switchboard.bookmarksDB.getBookmark((String) it.next()); - prop.putSafeXML("posts_"+count+"_url", bookmark.getUrl()); - prop.putSafeXML("posts_"+count+"_title", bookmark.getTitle()); - prop.putSafeXML("posts_"+count+"_description", bookmark.getDescription()); - prop.putSafeXML("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl())); + prop.put("posts_"+count+"_url", bookmark.getUrl()); + prop.put("posts_"+count+"_title", bookmark.getTitle()); + prop.put("posts_"+count+"_description", bookmark.getDescription()); + prop.put("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl())); date=new Date(bookmark.getTimeStamp()); - prop.putSafeXML("posts_"+count+"_time", serverDate.dateToiso8601(date)); - prop.putSafeXML("posts_"+count+"_tags", bookmark.getTagsString().replaceAll(","," ")); + prop.put("posts_"+count+"_time", serverDate.dateToiso8601(date)); + prop.put("posts_"+count+"_tags", bookmark.getTagsString().replaceAll(","," ")); // additional XML tags prop.put("posts_"+count+"_isExtended",extendedXML ? 1:0); if (extendedXML) { - prop.putSafeXML("posts_"+count+"_isExtended_private", Boolean.toString(!bookmark.getPublic())); + prop.put("posts_"+count+"_isExtended_private", Boolean.toString(!bookmark.getPublic())); } count++; } diff --git a/htroot/xml/bookmarks/posts/get.java b/htroot/xml/bookmarks/posts/get.java index 3d9d4eb80..f9a59300d 100644 --- a/htroot/xml/bookmarks/posts/get.java +++ b/htroot/xml/bookmarks/posts/get.java @@ -71,17 +71,17 @@ public class get { if(serverDate.dateToiso8601(new Date(bookmark.getTimeStamp())) == date && tag==null || bookmark.getTags().contains(tag) && isAdmin || bookmark.getPublic()){ - prop.putSafeXML("posts_"+count+"_url", bookmark.getUrl()); - prop.putSafeXML("posts_"+count+"_title", bookmark.getTitle()); - prop.putSafeXML("posts_"+count+"_description", bookmark.getDescription()); - prop.putSafeXML("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl())); - prop.putSafeXML("posts_"+count+"_time", date); - prop.putSafeXML("posts_"+count+"_tags", bookmark.getTagsString().replaceAll(","," ")); + prop.put("posts_"+count+"_url", bookmark.getUrl()); + prop.put("posts_"+count+"_title", bookmark.getTitle()); + prop.put("posts_"+count+"_description", bookmark.getDescription()); + prop.putASIS("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl())); + prop.put("posts_"+count+"_time", date); + prop.put("posts_"+count+"_tags", bookmark.getTagsString().replaceAll(","," ")); // additional XML tags prop.put("posts_"+count+"_isExtended",extendedXML ? 1:0); if (extendedXML) { - prop.putSafeXML("posts_"+count+"_isExtended_private", Boolean.toString(!bookmark.getPublic())); + prop.putASIS("posts_"+count+"_isExtended_private", Boolean.toString(!bookmark.getPublic())); } count++; } diff --git a/htroot/xml/queues_p.java b/htroot/xml/queues_p.java index 6a64f9f43..d6713f05a 100644 --- a/htroot/xml/queues_p.java +++ b/htroot/xml/queues_p.java @@ -125,11 +125,11 @@ public class queues_p { totalSize += entrySize; initiator = yacyCore.seedDB.getConnected(pcentry.initiator()); prop.put("list-indexing_"+i+"_profile", (pcentry.profile() != null) ? pcentry.profile().name() : "deleted"); - prop.putSafeXML("list-indexing_"+i+"_initiator", ((initiator == null) ? "proxy" : htmlTools.encodeUnicode2html(initiator.getName(), true))); + prop.put("list-indexing_"+i+"_initiator", ((initiator == null) ? "proxy" : htmlTools.encodeUnicode2html(initiator.getName(), true))); prop.put("list-indexing_"+i+"_depth", pcentry.depth()); prop.put("list-indexing_"+i+"_modified", pcentry.getModificationDate()); - prop.putSafeXML("list-indexing_"+i+"_anchor", (pcentry.anchorName()==null)?"":htmlTools.encodeUnicode2html(pcentry.anchorName(), true)); - prop.putSafeXML("list-indexing_"+i+"_url", pcentry.url().toNormalform(false, true)); + prop.put("list-indexing_"+i+"_anchor", (pcentry.anchorName()==null)?"":htmlTools.encodeUnicode2html(pcentry.anchorName(), true)); + prop.put("list-indexing_"+i+"_url", pcentry.url().toNormalform(false, true)); prop.put("list-indexing_"+i+"_size", entrySize); prop.put("list-indexing_"+i+"_inProcess", (inProcess)?1:0); prop.put("list-indexing_"+i+"_hash", pcentry.urlHash()); @@ -156,9 +156,9 @@ public class queues_p { if (theMsg == null) continue; prop.put("list-loader_"+count+"_profile", theMsg.profile.name()); initiator = yacyCore.seedDB.getConnected(theMsg.initiator); - prop.putSafeXML("list-loader_"+count+"_initiator", ((initiator == null) ? "proxy" : initiator.getName())); + prop.put("list-loader_"+count+"_initiator", ((initiator == null) ? "proxy" : initiator.getName())); prop.put("list-loader_"+count+"_depth", theMsg.depth ); - prop.putSafeXML("list-loader_"+count+"_url", theMsg.url.toString()); // null pointer exception here !!! maybe url = null; check reason. + prop.put("list-loader_"+count+"_url", theMsg.url.toString()); // null pointer exception here !!! maybe url = null; check reason. count++; } prop.put("list-loader", count ); @@ -198,8 +198,8 @@ public class queues_p { prop.put(tableName + "_" + showNum + "_initiator", ((initiator == null) ? "proxy" : initiator.getName())); prop.put(tableName + "_" + showNum + "_depth", urle.depth()); prop.put(tableName + "_" + showNum + "_modified", daydate(urle.loaddate())); - prop.putSafeXML(tableName + "_" + showNum + "_anchor", urle.name()); - prop.putSafeXML(tableName + "_" + showNum + "_url", urle.url().toNormalform(false, true)); + prop.put(tableName + "_" + showNum + "_anchor", urle.name()); + prop.put(tableName + "_" + showNum + "_url", urle.url().toNormalform(false, true)); prop.put(tableName + "_" + showNum + "_hash", urle.urlhash()); showNum++; } diff --git a/htroot/xml/snippet.java b/htroot/xml/snippet.java index 6f99809b5..710dcb811 100644 --- a/htroot/xml/snippet.java +++ b/htroot/xml/snippet.java @@ -70,7 +70,7 @@ public class snippet { } prop.put("link", 0); prop.put("links", 0); - prop.putSafeXML("favicon",snippet.getFavicon()==null?"":snippet.getFavicon().toString()); + prop.put("favicon",snippet.getFavicon()==null?"":snippet.getFavicon().toString()); } else { // attach media information ArrayList mediaSnippets = switchboard.snippetCache.retrieveMediaSnippets(url, queryHashes, media, true, mediasnippet_timeout); diff --git a/htroot/xml/util/getpageinfo_p.java b/htroot/xml/util/getpageinfo_p.java index 43525b342..444c9d8e7 100644 --- a/htroot/xml/util/getpageinfo_p.java +++ b/htroot/xml/util/getpageinfo_p.java @@ -95,12 +95,12 @@ public class getpageinfo_p { prop.put("title", scraper.getTitle()); // put the favicon that belongs to the document - prop.putSafeXML("favicon", (scraper.getFavicon()==null)?"":scraper.getFavicon().toString()); + prop.put("favicon", (scraper.getFavicon()==null)?"":scraper.getFavicon().toString()); // put keywords String list[]=scraper.getKeywords(); for(int i=0;i= yacyVersion.YACY_SUPPORTS_GZIP_POST_REQUESTS)) { - post.put(httpc.GZIP_POST_BODY,"true"); + post.putASIS(httpc.GZIP_POST_BODY,"true"); } post.put("wordc", Integer.toString(indexes.length)); @@ -978,8 +978,8 @@ public final class yacyClient { return result; } - post.put("entryc", Integer.toString(indexcount)); - post.put("indexes", entrypost.toString()); + post.put("entryc", indexcount); + post.putASIS("indexes", entrypost.toString()); try { final ArrayList v = nxTools.strings( httpc.wput( @@ -1018,7 +1018,7 @@ public final class yacyClient { // enabling gzip compression for post request body if ((gzipBody) && (targetSeed.getVersion() >= yacyVersion.YACY_SUPPORTS_GZIP_POST_REQUESTS)) { - post.put(httpc.GZIP_POST_BODY,"true"); + post.putASIS(httpc.GZIP_POST_BODY,"true"); } String resource = ""; @@ -1028,13 +1028,13 @@ public final class yacyClient { if (urls[i] != null) { resource = urls[i].toString(); if (resource != null) { - post.put("url" + urlc, resource); + post.putASIS("url" + urlc, resource); urlPayloadSize += resource.length(); urlc++; } } } - post.put("urlc", Integer.toString(urlc)); + post.put("urlc", urlc); try { final ArrayList v = nxTools.strings( httpc.wput(