Skip to content

Commit

Permalink
Move post check to routing
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jul 15, 2018
1 parent da74955 commit 124a311
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 4 additions & 0 deletions lib/net/nehmer/comments/config/routes.yml
Expand Up @@ -29,16 +29,20 @@ moderate_ajax:
report_abuse:
path: /report/abuse/{guid}/
defaults: { _controller: 'net_nehmer_comments_handler_moderate::abuse' }
methods: [POST]

report_confirm_abuse:
path: /report/confirm_abuse/{guid}/
defaults: { _controller: 'net_nehmer_comments_handler_moderate::confirm_abuse' }
methods: [POST]

report_not_abuse:
path: /report/not_abuse/{guid}/
defaults: { _controller: 'net_nehmer_comments_handler_moderate::not_abuse' }
methods: [POST]

report_confirm_junk:
path: /report/confirm_junk/{guid}/
defaults: { _controller: 'net_nehmer_comments_handler_moderate::confirm_junk' }
methods: [POST]

7 changes: 0 additions & 7 deletions lib/net/nehmer/comments/handler/moderate.php
Expand Up @@ -20,13 +20,6 @@ class net_nehmer_comments_handler_moderate extends midcom_baseclasses_components
*/
private $_comment;

public function _on_initialize()
{
if (empty($_POST)) {
throw new midcom_error('No post data found');
}
}

/**
* Marks comment as possible abuse
*
Expand Down

0 comments on commit 124a311

Please sign in to comment.