From 36a5a0e606641920728b27f179020461023667e8 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 7 Dec 2009 12:51:06 +0000 Subject: fixes #1018 - blank comments are now rejected git-svn-id: http://code.elgg.org/elgg/trunk@3737 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/comments/add.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actions') 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)) { -- cgit v1.2.3