aboutsummaryrefslogtreecommitdiff
path: root/actions/comments/delete.php
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2012-05-18 11:44:19 -0300
committerSteve Clay <steve@mrclay.org>2012-05-18 11:44:19 -0300
commit5a432ff2474e70caf88c19a8b413405d14e61d4d (patch)
treea51be7ea4da9195958eae480117479e012a702cc /actions/comments/delete.php
parent14d2c70e1872f4045fc857be9b9022d085f1fbd1 (diff)
downloadelgg-5a432ff2474e70caf88c19a8b413405d14e61d4d.tar.gz
elgg-5a432ff2474e70caf88c19a8b413405d14e61d4d.tar.bz2
Fixes #4480: Forward to REFERER after comment delete
Diffstat (limited to 'actions/comments/delete.php')
-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