aboutsummaryrefslogtreecommitdiff
path: root/mod/likes/actions
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2012-06-19 19:35:55 -0400
committercash <cash.costello@gmail.com>2012-06-19 19:35:55 -0400
commite3222535a07e39ffe506eb9688db515798ebf2a4 (patch)
tree08eb754915cbbff4deac64a4707b2515dc1bdbaf /mod/likes/actions
parentd71309056037adc869319566f9ec53313eb192d8 (diff)
downloadelgg-e3222535a07e39ffe506eb9688db515798ebf2a4.tar.gz
elgg-e3222535a07e39ffe506eb9688db515798ebf2a4.tar.bz2
Fixes #4606 made unlike code consistent and functional
Diffstat (limited to 'mod/likes/actions')
-rw-r--r--mod/likes/actions/likes/delete.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/mod/likes/actions/likes/delete.php b/mod/likes/actions/likes/delete.php
index db3036bb4..88cb84467 100644
--- a/mod/likes/actions/likes/delete.php
+++ b/mod/likes/actions/likes/delete.php
@@ -4,17 +4,12 @@
*
*/
-$likes = elgg_get_annotations(array(
- 'guid' => (int) get_input('guid'),
- 'annotation_owner_guid' => elgg_get_logged_in_user_guid(),
- 'annotation_name' => 'likes',
-));
-if ($likes) {
- if ($likes[0]->canEdit()) {
- $likes[0]->delete();
- system_message(elgg_echo("likes:deleted"));
- forward(REFERER);
- }
+$id = (int) get_input('id');
+$like = elgg_get_annotation_from_id($id);
+if ($like && $like->canEdit()) {
+ $like->delete();
+ system_message(elgg_echo("likes:deleted"));
+ forward(REFERER);
}
register_error(elgg_echo("likes:notdeleted"));