aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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!',