Skip to content

Commit

Permalink
Merge pull request cakephp#823 from shockone/patch-6
Browse files Browse the repository at this point in the history
Use CakeRequest::onlyAllow() instead of CakeRequest::is()
  • Loading branch information
markstory committed Oct 19, 2013
2 parents 7c7f4e7 + 44b1cca commit f889548
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions en/tutorials-and-examples/blog-auth-example/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ with CakePHP::
}

public function delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->request->onlyAllow('post');

$this->User->id = $id;
if (!$this->User->exists()) {
throw new NotFoundException(__('Invalid user'));
Expand Down

0 comments on commit f889548

Please sign in to comment.