Index: src/net/sourceforge/pebble/web/action/AbstractCommentAction.java
===================================================================
--- src/net/sourceforge/pebble/web/action/AbstractCommentAction.java (revision 220)
+++ src/net/sourceforge/pebble/web/action/AbstractCommentAction.java (working copy)
@@ -47,7 +47,17 @@
protected ValidationContext validateComment(Comment comment) {
ValidationContext context = new ValidationContext();
+/*
+ * This static method call does not work when the classes are retrowoven to 1.4.
+ * The method is quite short (a single if statement) so it is imported in place
+ * of the static call.
MailUtils.validate(comment.getEmail(), context);
+
+*/
+ if (comment.getEmail() != null && !comment.getEmail().matches("[A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\\.[A-Za-z]{2,}")) {
+ context.addError(comment.getEmail() + " is not a valid e-mail address");
+ }
+
getModel().put("validationContext", context);
return context;
}
@@ -87,4 +97,4 @@
}
}
-}
\ No newline at end of file
+}
Index: build.xml
===================================================================
--- build.xml (revision 220)
+++ build.xml (working copy)
@@ -13,6 +13,8 @@
+
+
@@ -47,6 +49,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -102,6 +115,9 @@
+
+
+
@@ -153,6 +169,8 @@
+
+