From 32dacb93696bc49b8933951aa290d1ed0c26504b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 8 Mar 2015 19:44:23 +0100 Subject: [PATCH] ROLLBACK queries in the proper order --- actions/newapplication.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/actions/newapplication.php b/actions/newapplication.php index ad71aaad0a..d3dd9b291a 100644 --- a/actions/newapplication.php +++ b/actions/newapplication.php @@ -28,9 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * Add a new application @@ -51,10 +49,8 @@ class NewApplicationAction extends FormAction return _('New application'); } - protected function handlePost() + protected function doPost() { - parent::handlePost(); - if ($this->arg('cancel')) { common_redirect(common_local_url('oauthappssettings'), 303); } elseif ($this->arg('save')) { @@ -181,6 +177,7 @@ class NewApplicationAction extends FormAction if (!$result) { common_log_db_error($consumer, 'INSERT', __FILE__); + $app->query('ROLLBACK'); // TRANS: Server error displayed when an application could not be registered in the database through the "New application" form. $this->serverError(_('Could not create application.')); } @@ -191,9 +188,9 @@ class NewApplicationAction extends FormAction if (!$this->app_id) { common_log_db_error($app, 'INSERT', __FILE__); + $app->query('ROLLBACK'); // TRANS: Server error displayed when an application could not be registered in the database through the "New application" form. $this->serverError(_('Could not create application.')); - $app->query('ROLLBACK'); } try { -- 2.39.5