aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-07 12:51:06 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-07 12:51:06 +0000
commit36a5a0e606641920728b27f179020461023667e8 (patch)
treea82b30fb8129a7e8bc75398432aef6e120285916
parent450a54397f61f2fe53c8638459aad7ba9bc1c069 (diff)
downloadelgg-36a5a0e606641920728b27f179020461023667e8.tar.gz
elgg-36a5a0e606641920728b27f179020461023667e8.tar.bz2
fixes #1018 - blank comments are now rejected
git-svn-id: http://code.elgg.org/elgg/trunk@3737 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/comments/add.php6
-rw-r--r--languages/en.php6
2 files changed, 9 insertions, 3 deletions
diff --git a/actions/comments/add.php b/actions/comments/add.php
index 62fc2d0e0..4d01fe1b0 100644
--- a/actions/comments/add.php
+++ b/actions/comments/add.php
@@ -15,6 +15,12 @@ action_gatekeeper();
$entity_guid = (int) get_input('entity_guid');
$comment_text = get_input('generic_comment');
+// make sure comment is not empty
+if (empty($comment_text)) {
+ register_error(elgg_echo("generic_comment:blank"));
+ forward($_SERVER['HTTP_REFERER']);
+}
+
// Let's see if we can get an entity with the specified GUID
if ($entity = get_entity($entity_guid)) {
diff --git a/languages/en.php b/languages/en.php
index 8e9171d53..1972a81e7 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -824,9 +824,9 @@ If you requested this click on the link below, otherwise ignore this email.
'generic_comments:text' => "Comment",
'generic_comment:posted' => "Your comment was successfully posted.",
'generic_comment:deleted' => "Your comment was successfully deleted.",
- 'generic_comment:blank' => "Sorry; you need to actually put something in your comment before we can save it.",
- 'generic_comment:notfound' => "Sorry; we could not find the specified item.",
- 'generic_comment:notdeleted' => "Sorry; we could not delete this comment.",
+ 'generic_comment:blank' => "Sorry, you need to actually put something in your comment before we can save it.",
+ 'generic_comment:notfound' => "Sorry, we could not find the specified item.",
+ 'generic_comment:notdeleted' => "Sorry, we could not delete this comment.",
'generic_comment:failure' => "An unexpected error occurred when adding your comment. Please try again.",
'generic_comment:email:subject' => 'You have a new comment!',