aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-06-02 08:00:03 -0700
committerCash Costello <cash.costello@gmail.com>2012-06-02 08:00:03 -0700
commite1ad0033a34576b663caca96091eeed012d3447b (patch)
tree214bfb1578fa57ecd9fbeb1e28b115b33c98d23a /actions
parentedb6a30963e704a102ba0032af98b5ccbb6bdbe4 (diff)
parent5a432ff2474e70caf88c19a8b413405d14e61d4d (diff)
downloadelgg-e1ad0033a34576b663caca96091eeed012d3447b.tar.gz
elgg-e1ad0033a34576b663caca96091eeed012d3447b.tar.bz2
Merge pull request #238 from mrclay/patch-6
Fixes #4480: Forward to REFERER after comment delete
Diffstat (limited to 'actions')
-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