Skip to content

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

- don't publish news if empty or equal page is submitted in wiki

karlchenofhellde1b4a173197
diff --git a/htroot/Wiki.java b/htroot/Wiki.java
index 3d18e87b3..c0f52f0c1 100644
--- a/htroot/Wiki.java
+++ b/htroot/Wiki.java
@@ -106,6 +106,8 @@ public class Wiki {
}
if (access.equals("admin")) prop.put("mode_access", 0);
if (access.equals("all")) prop.put("mode_access", 1);
+
+ wikiBoard.entry page = switchboard.wikiDB.read(pagename);
if (post.containsKey("submit")) {
@@ -122,17 +124,18 @@ public class Wiki {
} catch (UnsupportedEncodingException e) {
content = post.get("content", "").getBytes();
}
- switchboard.wikiDB.write(switchboard.wikiDB.newEntry(pagename, author, ip, post.get("reason", "edit"), content));
+ wikiBoard.entry newEntry = switchboard.wikiDB.newEntry(pagename, author, ip, post.get("reason", "edit"), content);
+ switchboard.wikiDB.write(newEntry);
// create a news message
HashMap map = new HashMap();
map.put("page", pagename);
map.put("author", author.replace(',', ' '));
- yacyCore.newsPool.publishMyNews(new yacyNewsRecord("wiki_upd", map));
+ if (!page.page().equals(content))
+ yacyCore.newsPool.publishMyNews(new yacyNewsRecord("wiki_upd", map));
+ page = newEntry;
prop.put("LOCATION", "/Wiki.html?page=" + pagename);
}
- wikiBoard.entry page = switchboard.wikiDB.read(pagename);
-
if (post.containsKey("edit")) {
if ((access.equals("admin") && (!switchboard.verifyAuthentication(header, true)))) {
// check access right for admin