diff options
Diffstat (limited to 'mod/reportedcontent/actions/add.php')
-rw-r--r-- | mod/reportedcontent/actions/add.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/add.php index 3f818ca3c..c43e14baa 100644 --- a/mod/reportedcontent/actions/add.php +++ b/mod/reportedcontent/actions/add.php @@ -26,8 +26,13 @@ $entity->access_id = $access;
if ($entity->save()) {
- system_message(elgg_echo('reportedcontent:success'));
- $entity->state = "active";
+ if (!trigger_plugin_hook('reportedcontent:add', $entity->type, array('entity'=>$entity), true)) {
+ $entity->delete();
+ register_error(elgg_echo('reportedcontent:failed'));
+ } else {
+ system_message(elgg_echo('reportedcontent:success'));
+ $entity->state = "active";
+ }
forward($address);
} else {
register_error(elgg_echo('reportedcontent:failed'));
|