Skip to content

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

fix for wrong deletion in profile editor

orbiter2ed808366a60
diff --git a/htroot/CrawlProfileEditor_p.html b/htroot/CrawlProfileEditor_p.html
index ac4559232..1eb02bc80 100644
--- a/htroot/CrawlProfileEditor_p.html
+++ b/htroot/CrawlProfileEditor_p.html
@@ -16,7 +16,6 @@
<!-- crawl profile list -->
-<form action="CrawlProfileEditor_p.html" method="get" enctype="multipart/form-data">
<fieldset><legend>Crawl Profile List</legend>
<table border="0" cellpadding="2" cellspacing="1">
<colgroup>
@@ -60,16 +59,17 @@
<td>#(indexMedia)#no::yes#(/indexMedia)#</td>
<td>#(remoteIndexing)#no::yes#(/remoteIndexing)#</td>
<td>#(deleteButton)#::
+ <form action="CrawlProfileEditor_p.html" method="get" enctype="multipart/form-data">
<pre><input type="hidden" name="handle" value="#[handle]#" /></pre>
<pre><input type="submit" name="deleteprofile" value="Delete" /></pre>
#(/deleteButton)#
-
- </td>
+ </form>
+ </td>
</tr>
#{/crawlProfiles}#
</table>
</fieldset>
-</form>
+
<!-- crawl profile editor -->
<form action="CrawlProfileEditor_p.html" method="post" enctype="multipart/form-data">
diff --git a/htroot/CrawlProfileEditor_p.java b/htroot/CrawlProfileEditor_p.java
index 41ca20118..a24e8f9e3 100644
--- a/htroot/CrawlProfileEditor_p.java
+++ b/htroot/CrawlProfileEditor_p.java
@@ -102,14 +102,10 @@ public class CrawlProfileEditor_p {
final plasmaSwitchboard sb = (plasmaSwitchboard)env;
// read post for handle
- String handle = "";
- if (post != null) {
- handle = post.get("handle", "");
-
- if (post.containsKey("deleteprofile")) {
- // deletion of a crawl
- if (handle != null) sb.profiles.removeEntry(handle);
- }
+ String handle = (post == null) ? "" : post.get("handle", "");
+ if ((post != null) && (post.containsKey("deleteprofile"))) {
+ // deletion of a crawl
+ sb.profiles.removeEntry(handle);
}
// generate handle list