aboutsummaryrefslogtreecommitdiff
path: root/actions/comments
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-01 23:31:08 +0200
committerSem <sembrestels@riseup.net>2012-07-01 23:31:08 +0200
commitea0140d87534c3b10e489d13a1449ebb79da832d (patch)
tree85667ae651bc5cc9f0ea01c6f3871bbdee36a469 /actions/comments
parent157117475338bcaab5fc3453ec54250343da595c (diff)
parent671f9ba4e1b1972d8eaf22acfb626fa2c85af0f2 (diff)
downloadelgg-ea0140d87534c3b10e489d13a1449ebb79da832d.tar.gz
elgg-ea0140d87534c3b10e489d13a1449ebb79da832d.tar.bz2
Merge branch 'lorea-preprod'
Diffstat (limited to 'actions/comments')
-rw-r--r--actions/comments/delete.php17
1 files changed, 5 insertions, 12 deletions
diff --git a/actions/comments/delete.php b/actions/comments/delete.php
index f8458a152..f2c058ff4 100644
--- a/actions/comments/delete.php
+++ b/actions/comments/delete.php
@@ -12,19 +12,12 @@ if (!elgg_is_logged_in()) {
// Make sure we can get the comment in question
$annotation_id = (int) get_input('annotation_id');
-if ($comment = elgg_get_annotation_from_id($annotation_id)) {
-
- $entity = get_entity($comment->entity_guid);
-
- if ($comment->canEdit()) {
- $comment->delete();
- system_message(elgg_echo("generic_comment:deleted"));
- forward($entity->getURL());
- }
-
+$comment = elgg_get_annotation_from_id($annotation_id);
+if ($comment && $comment->canEdit()) {
+ $comment->delete();
+ system_message(elgg_echo("generic_comment:deleted"));
} else {
- $url = "";
+ register_error(elgg_echo("generic_comment:notdeleted"));
}
-register_error(elgg_echo("generic_comment:notdeleted"));
forward(REFERER); \ No newline at end of file