X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fdeleteapplication.php;h=1d9e6d1bb5bf84c6ebc715c882782d1522541772;hb=72c86913a427e4626b8b43cb725a65cd7f7a0f3c;hp=8c3b8e0ba7e8f9caf22de417beb8cdee77f4f9e4;hpb=8884a5255fb90fda67b63fa0d4252d77176337e5;p=quix0rs-gnu-social.git diff --git a/actions/deleteapplication.php b/actions/deleteapplication.php index 8c3b8e0ba7..1d9e6d1bb5 100644 --- a/actions/deleteapplication.php +++ b/actions/deleteapplication.php @@ -51,7 +51,7 @@ class DeleteapplicationAction extends Action * * @return boolean success flag */ - function prepare($args) + function prepare(array $args=array()) { if (!parent::prepare($args)) { return false; @@ -60,16 +60,14 @@ class DeleteapplicationAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed trying to delete an application while not logged in. $this->clientError(_('You must be logged in to delete an application.')); - return false; } $id = (int)$this->arg('id'); - $this->app = Oauth_application::staticGet('id', $id); + $this->app = Oauth_application::getKV('id', $id); if (empty($this->app)) { // TRANS: Client error displayed trying to delete an application that does not exist. $this->clientError(_('Application not found.')); - return false; } $cur = common_current_user(); @@ -77,7 +75,6 @@ class DeleteapplicationAction extends Action if ($cur->id != $this->app->owner) { // TRANS: Client error displayed trying to delete an application the current user does not own. $this->clientError(_('You are not the owner of this application.'), 401); - return false; } return true; @@ -92,7 +89,7 @@ class DeleteapplicationAction extends Action * * @return void */ - function handle($args) + function handle(array $args=array()) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -101,7 +98,6 @@ class DeleteapplicationAction extends Action if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.')); - return; } if ($this->arg('no')) {