branch pollen-udpate-1.6 updated (231943b -> 23c7976)
This is an automated email from the git hooks/post-receive script. New change to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git from 231943b Add <strong> on link new 23c7976 fixes #1301: [Comment] Add anti spam filter vote vote and comments The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 23c797688f0dd99a56b868128acc817c54f384fc Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Wed Nov 18 22:22:19 2015 +0100 fixes #1301: [Comment] Add anti spam filter vote vote and comments Summary of changes: .../chorem/pollen/ui/actions/poll/vote/AddComment.java | 17 +++++++++++++++++ .../src/main/webapp/WEB-INF/jsp/poll/vote.jsp | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 23c797688f0dd99a56b868128acc817c54f384fc Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Wed Nov 18 22:22:19 2015 +0100 fixes #1301: [Comment] Add anti spam filter vote vote and comments --- .../chorem/pollen/ui/actions/poll/vote/AddComment.java | 17 +++++++++++++++++ .../src/main/webapp/WEB-INF/jsp/poll/vote.jsp | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java index 2e50761..42464fe 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java @@ -44,6 +44,8 @@ public class AddComment extends AbstractVoteAction implements Preparable { */ private String commentText; + protected String commentUrl; + public void setCommentText(String commentText) { this.commentText = commentText; } @@ -51,6 +53,14 @@ public class AddComment extends AbstractVoteAction implements Preparable { public String getCommentText() { return commentText; } + + public String getCommentUrl() { + return commentUrl; + } + + public void setCommentUrl(String commentUrl) { + this.commentUrl = commentUrl; + } @Override public boolean isModerate() { @@ -74,6 +84,13 @@ public class AddComment extends AbstractVoteAction implements Preparable { if (StringUtils.isBlank(getCommentText())) { addFieldError("commentText", t("pollen.error.comment.text.empty")); } + + // comment url field is present in form but NOT displayed to user + // if a value is filled, this should a spam robot that try to fill all field + // reject actin in this case + if (StringUtils.isNotBlank(commentUrl)) { + addActionError(t("pollen.error.comment.spam")); + } } @InputConfig(methodName = PREPARE_VOTE_PAGE) diff --git a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp index 0d55c93..40a5bd8 100644 --- a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp +++ b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp @@ -4,7 +4,7 @@ $Id$ $HeadURL$ %% - Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit, Chatellier Eric %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by @@ -396,6 +396,9 @@ <s:textfield key="commentAuthor" requiredLabel="true" size="78" label="%{getText('pollen.common.commentAuthor')}"/> + <%-- anti spam field --%> + <input type="text" name="commentUrl" class="hidden" /> + <s:url var="configUrl" value='/js/ckeditor.config.js'/> <sjr:ckeditor key="commentText" requiredLabel="true" value="" rows="3" cols="54" width="500" -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm