aboutsummaryrefslogtreecommitdiff
path: root/actions/likes/add.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/likes/add.php')
-rw-r--r--actions/likes/add.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/actions/likes/add.php b/actions/likes/add.php
index 3de1ebc51..9abe0b60e 100644
--- a/actions/likes/add.php
+++ b/actions/likes/add.php
@@ -20,6 +20,12 @@ if (!$entity) {
forward(REFERER);
}
+// cannot like your own stuff
+if (get_loggedin_userid() == $entity->getOwnerGUID()) {
+ register_error(elgg_echo("likes:no_self_like"));
+ forward(REFERER);
+}
+
$user = get_loggedin_user();
$annotation = create_annotation($entity->guid,
'likes',