From e9fc32bf7187a4c9ee3aa9617c64ca33e6a65a11 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 6 Nov 2015 07:39:53 -0500 Subject: [PATCH] Clarify logic See https://github.com/dseguy/clearPHP/blob/master/rules/no-implied-if.md Signed-off-by: Marc Delisle --- libraries/server_privileges.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index b5be235eb4..9a7b21c6dc 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -2095,12 +2095,13 @@ function PMA_updatePassword($err_url, $username, $hostname) . $hostname . "';"; // Update the plugin for the user - $GLOBALS['dbi']->tryQuery($update_plugin_query) - or Util::mysqlDie( + if (!($GLOBALS['dbi']->tryQuery($update_plugin_query))) { + Util::mysqlDie( $GLOBALS['dbi']->getError(), $update_plugin_query, false, $err_url ); + } $GLOBALS['dbi']->tryQuery("FLUSH PRIVILEGES;"); @@ -2153,10 +2154,11 @@ function PMA_updatePassword($err_url, $username, $hostname) . '(\'' . Util::sqlAddSlashes($_POST['pma_pw']) . '\')'); } - $GLOBALS['dbi']->tryQuery($local_query) - or Util::mysqlDie( + if (!($GLOBALS['dbi']->tryQuery($local_query))) { + Util::mysqlDie( $GLOBALS['dbi']->getError(), $sql_query, false, $err_url ); + } $message = Message::success( __('The password for %s was changed successfully.') );