]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4480: Forward to REFERER after comment delete
authorSteve Clay <steve@mrclay.org>
Fri, 18 May 2012 14:44:19 +0000 (11:44 -0300)
committerSteve Clay <steve@mrclay.org>
Fri, 18 May 2012 14:44:19 +0000 (11:44 -0300)
actions/comments/delete.php

index f8458a15253862652a17510f49612ca0b5870446..f2c058ff4b77d5c135bb19f096b074a17f626dc7 100644 (file)
@@ -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