aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/likes/add.php6
-rw-r--r--actions/likes/delete.php2
2 files changed, 7 insertions, 1 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',
diff --git a/actions/likes/delete.php b/actions/likes/delete.php
index 45984b581..7ccf2de37 100644
--- a/actions/likes/delete.php
+++ b/actions/likes/delete.php
@@ -20,7 +20,7 @@ if ($likes = get_annotation($annotation_id)) {
if ($likes->canEdit()) {
$likes->delete();
system_message(elgg_echo("likes:deleted"));
- forward($entity->getURL());
+ forward(REFERER);
}
} else {