From f06883d2a71ea597657c54dcaada09485fc44abd Mon Sep 17 00:00:00 2001 From: Hugues Peccatte Date: Sun, 13 Jan 2019 00:27:55 +0100 Subject: [PATCH] Remove useless parenthesis Signed-off-by: Hugues Peccatte --- db_central_columns.php | 2 +- error_report.php | 4 +- export.php | 2 +- gis_data_editor.php | 4 +- js/messages.php | 4 +- libraries/classes/CheckUserPrivileges.php | 2 +- libraries/classes/Config/FormDisplay.php | 4 +- libraries/classes/Config/Validator.php | 2 +- .../Database/DatabaseStructureController.php | 20 +++---- .../Table/TableSearchController.php | 4 +- libraries/classes/Database/Qbe.php | 2 +- libraries/classes/Display/Results.php | 12 ++-- .../classes/Gis/GisGeometryCollection.php | 4 +- libraries/classes/Gis/GisPolygon.php | 2 +- libraries/classes/Header.php | 2 +- libraries/classes/Import.php | 12 ++-- libraries/classes/Linter.php | 3 +- libraries/classes/Menu.php | 2 +- libraries/classes/MultSubmits.php | 2 +- .../classes/Navigation/NavigationTree.php | 4 +- .../Nodes/NodeDatabaseChildContainer.php | 4 +- .../classes/Plugins/Export/ExportSql.php | 14 ++--- .../classes/Plugins/Export/ExportXml.php | 2 +- .../classes/Plugins/Export/Helpers/Pdf.php | 2 +- .../classes/Plugins/Import/ImportSql.php | 2 +- .../Plugins/Schema/Pdf/PdfRelationSchema.php | 14 ++--- .../Input/Text_Plain_Iptobinary.php | 2 +- libraries/classes/Relation.php | 2 +- libraries/classes/ReplicationGui.php | 2 +- libraries/classes/Rte/Footer.php | 4 +- libraries/classes/Rte/Routines.php | 2 +- libraries/classes/Server/Privileges.php | 60 ++++++++----------- libraries/classes/Server/Status/Data.php | 2 +- libraries/classes/Server/Status/Processes.php | 12 ++-- libraries/classes/Sql.php | 4 +- libraries/classes/Tracker.php | 2 +- libraries/classes/Tracking.php | 12 ++-- libraries/classes/UserPassword.php | 2 +- libraries/classes/Util.php | 12 ++-- libraries/classes/ZipExtension.php | 8 +-- libraries/tbl_columns_definition_form.inc.php | 5 +- libraries/user_preferences.inc.php | 2 +- tbl_export.php | 6 +- tbl_operations.php | 10 ++-- version_check.php | 4 +- 45 files changed, 137 insertions(+), 147 deletions(-) diff --git a/db_central_columns.php b/db_central_columns.php index 6d60688b8d..aa42d67b34 100644 --- a/db_central_columns.php +++ b/db_central_columns.php @@ -147,7 +147,7 @@ $response->addHTML($main); $num_cols = $centralColumns->getColumnsCount($db, $pos, $max_rows); $message = Message::success( - sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + $num_cols)) + sprintf(__('Showing rows %1$s - %2$s.'), $pos + 1, $pos + $num_cols) ); if (isset($tmp_msg) && $tmp_msg !== true) { $message = $tmp_msg; diff --git a/error_report.php b/error_report.php index e9b1aeb32d..a002c114f3 100644 --- a/error_report.php +++ b/error_report.php @@ -51,9 +51,9 @@ if (isset($_POST['send_error_report']) } else { $_SESSION['prev_error_subm_time'] = time(); $_SESSION['error_subm_count'] = ( - (isset($_SESSION['error_subm_count'])) + isset($_SESSION['error_subm_count']) ? ($_SESSION['error_subm_count'] + 1) - : (0) + : 0 ); } } diff --git a/export.php b/export.php index 7d6f623368..5aa7519afc 100644 --- a/export.php +++ b/export.php @@ -304,7 +304,7 @@ if ($export_type == 'server') { // preference over SQL Query aliases. $parser = new \PhpMyAdmin\SqlParser\Parser($sql_query); $aliases = []; -if ((! empty($parser->statements[0])) +if (! empty($parser->statements[0]) && ($parser->statements[0] instanceof \PhpMyAdmin\SqlParser\Statements\SelectStatement) ) { $aliases = \PhpMyAdmin\SqlParser\Utils\Misc::getAliases($parser->statements[0], $db); diff --git a/gis_data_editor.php b/gis_data_editor.php index f7ca095c59..da55762518 100644 --- a/gis_data_editor.php +++ b/gis_data_editor.php @@ -56,7 +56,7 @@ if (! isset($gis_data['gis_type'])) { mb_strpos($_POST['value'], "(") - $start ); } - if ((! isset($gis_data['gis_type'])) + if (! isset($gis_data['gis_type']) || (! in_array($gis_data['gis_type'], $gis_types)) ) { $gis_data['gis_type'] = $gis_types[0]; @@ -111,7 +111,7 @@ if (isset($_POST['generate']) && $_POST['generate'] == true) { $geom_count = 1; if ($geom_type == 'GEOMETRYCOLLECTION') { - $geom_count = (isset($gis_data[$geom_type]['geom_count'])) + $geom_count = isset($gis_data[$geom_type]['geom_count']) ? intval($gis_data[$geom_type]['geom_count']) : 1; if (isset($gis_data[$geom_type]['add_geom'])) { $geom_count++; diff --git a/js/messages.php b/js/messages.php index 76ff2b0128..7430ec79b5 100644 --- a/js/messages.php +++ b/js/messages.php @@ -724,7 +724,7 @@ $js_messages['phpErrorsBeingSubmitted'] = '
' ) . '
' . 'ajax clock' . '
'; $js_messages['strCopyQueryButtonSuccess'] = __('Successfully copied!'); @@ -900,7 +900,7 @@ Sanitize::printJsValue( /* l10n: Month-year order for calendar, use either "calendar-month-year" * or "calendar-year-month". */ - (__('calendar-month-year') == 'calendar-year-month') + __('calendar-month-year') == 'calendar-year-month' ); /* l10n: Year suffix for calendar, "none" is empty. */ $year_suffix = _pgettext('Year suffix', 'none'); diff --git a/libraries/classes/CheckUserPrivileges.php b/libraries/classes/CheckUserPrivileges.php index 8d72bcdc99..cb4d9c1094 100644 --- a/libraries/classes/CheckUserPrivileges.php +++ b/libraries/classes/CheckUserPrivileges.php @@ -69,7 +69,7 @@ class CheckUserPrivileges $show_grants_str = mb_substr( $row, 6, - (mb_strpos($row, ' ON ') - 6) + mb_strpos($row, ' ON ') - 6 ); $show_grants_tblname = mb_substr( diff --git a/libraries/classes/Config/FormDisplay.php b/libraries/classes/Config/FormDisplay.php index c8bfb39462..88daf76a78 100644 --- a/libraries/classes/Config/FormDisplay.php +++ b/libraries/classes/Config/FormDisplay.php @@ -893,8 +893,8 @@ class FormDisplay $opts['comment_warning'] = true; } if (! $GLOBALS['PMA_Config']->get('is_setup')) { - if (($systemPath == 'MaxDbList' || $systemPath == 'MaxTableList' - || $systemPath == 'QueryHistoryMax') + if ($systemPath == 'MaxDbList' || $systemPath == 'MaxTableList' + || $systemPath == 'QueryHistoryMax' ) { $opts['comment'] = sprintf( __('maximum %s'), diff --git a/libraries/classes/Config/Validator.php b/libraries/classes/Config/Validator.php index 2a00fa3931..2d428ba447 100644 --- a/libraries/classes/Config/Validator.php +++ b/libraries/classes/Config/Validator.php @@ -570,7 +570,7 @@ class Validator return ''; } $result = preg_match($regex, Util::requestString($values[$path])); - return [$path => ($result ? '' : __('Incorrect value!'))]; + return [$path => $result ? '' : __('Incorrect value!')]; } /** diff --git a/libraries/classes/Controllers/Database/DatabaseStructureController.php b/libraries/classes/Controllers/Database/DatabaseStructureController.php index 23c2802c41..e66b2ed372 100644 --- a/libraries/classes/Controllers/Database/DatabaseStructureController.php +++ b/libraries/classes/Controllers/Database/DatabaseStructureController.php @@ -309,7 +309,7 @@ class DatabaseStructureController extends DatabaseController 'db' => $this->db, 'ajax_request' => true, 'favorite_table' => $favorite_table, - (($already_favorite ? 'remove' : 'add') . '_favorite') => true, + ($already_favorite ? 'remove' : 'add') . '_favorite' => true, ]; $this->response->addJSON([ 'user' => $user, @@ -644,12 +644,12 @@ class DatabaseStructureController extends DatabaseController 'formatted_size' => $formatted_size, 'unit' => $unit, 'overhead' => $overhead, - 'create_time' => (isset($create_time) && $create_time - ? Util::localisedDate(strtotime($create_time)) : '-'), - 'update_time' => (isset($update_time) && $update_time - ? Util::localisedDate(strtotime($update_time)) : '-'), - 'check_time' => (isset($check_time) && $check_time - ? Util::localisedDate(strtotime($check_time)) : '-'), + 'create_time' => isset($create_time) && $create_time + ? Util::localisedDate(strtotime($create_time)) : '-', + 'update_time' => isset($update_time) && $update_time + ? Util::localisedDate(strtotime($update_time)) : '-', + 'check_time' => isset($check_time) && $check_time + ? Util::localisedDate(strtotime($check_time)) : '-', 'charset' => isset($charset) ? $charset : '', 'is_show_stats' => $this->_is_show_stats, @@ -691,9 +691,9 @@ class DatabaseStructureController extends DatabaseController 'db_charset' => $db_charset, 'sum_size' => $sum_size, 'overhead_size' => $overhead_size, - 'create_time_all' => ($create_time_all ? Util::localisedDate(strtotime($create_time_all)) : '-'), - 'update_time_all' => ($update_time_all ? Util::localisedDate(strtotime($update_time_all)) : '-'), - 'check_time_all' => ($check_time_all ? Util::localisedDate(strtotime($check_time_all)) : '-'), + 'create_time_all' => $create_time_all ? Util::localisedDate(strtotime($create_time_all)) : '-', + 'update_time_all' => $update_time_all ? Util::localisedDate(strtotime($update_time_all)) : '-', + 'check_time_all' => $check_time_all ? Util::localisedDate(strtotime($check_time_all)) : '-', 'approx_rows' => $overall_approx_rows, 'num_favorite_tables' => $GLOBALS['cfg']['NumFavoriteTables'], 'db' => $GLOBALS['db'], diff --git a/libraries/classes/Controllers/Table/TableSearchController.php b/libraries/classes/Controllers/Table/TableSearchController.php index 6ede4081f7..155a01a20f 100644 --- a/libraries/classes/Controllers/Table/TableSearchController.php +++ b/libraries/classes/Controllers/Table/TableSearchController.php @@ -570,9 +570,9 @@ class TableSearchController extends TableController 'criteria_column_types' => isset($_POST['criteriaColumnTypes']) ? $_POST['criteriaColumnTypes'] : null, 'sql_types' => $this->dbi->types, 'max_rows' => intval($GLOBALS['cfg']['MaxRows']), - 'max_plot_limit' => (! empty($_POST['maxPlotLimit']) + 'max_plot_limit' => ! empty($_POST['maxPlotLimit']) ? intval($_POST['maxPlotLimit']) - : intval($GLOBALS['cfg']['maxRowPlotLimit'])), + : intval($GLOBALS['cfg']['maxRowPlotLimit']), ]) ); } diff --git a/libraries/classes/Database/Qbe.php b/libraries/classes/Database/Qbe.php index 1d2a2a19eb..0b73ebb81c 100644 --- a/libraries/classes/Database/Qbe.php +++ b/libraries/classes/Database/Qbe.php @@ -923,7 +923,7 @@ class Qbe $html_output .= $this->_getAndOrColCell( $new_column_count, $checked_options, - ($column_index + 1 == $this->_criteria_column_count) + $column_index + 1 == $this->_criteria_column_count ); $new_column_count++; } // end for diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php index 44380aa1ce..52e526a3bb 100644 --- a/libraries/classes/Display/Results.php +++ b/libraries/classes/Display/Results.php @@ -1423,7 +1423,7 @@ class Results && ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE) ? 4 : 0; $button_html .= ''; - } elseif (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE)) { + } elseif ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE) { // ... elseif display an empty column if the actions links are // disabled to match the rest of the table $button_html .= ''; @@ -1451,7 +1451,7 @@ class Results private function _getTableCommentsArray(array $analyzed_sql_results) { if (! $GLOBALS['cfg']['ShowBrowseComments'] - || (empty($analyzed_sql_results['statement']->from)) + || empty($analyzed_sql_results['statement']->from) ) { return []; } @@ -2893,7 +2893,7 @@ class Results include_once ROOT_PATH . 'libraries/special_schema_links.inc.php'; if (isset($GLOBALS['special_schema_links']) - && (! empty($GLOBALS['special_schema_links'][$dbLower][$tblLower][$nameLower])) + && ! empty($GLOBALS['special_schema_links'][$dbLower][$tblLower][$nameLower]) ) { $linking_url = $this->_getSpecialLinkUrl( $row[$i], @@ -3315,7 +3315,7 @@ class Results 'table' => $this->__get('table'), 'sql_query' => $url_sql_query, 'message_to_show' => __('The row has been deleted.'), - 'goto' => (empty($goto) ? 'tbl_sql.php' : $goto), + 'goto' => empty($goto) ? 'tbl_sql.php' : $goto, ]; $lnk_goto = 'sql.php' . Url::getCommonRaw($_url_params); @@ -4250,7 +4250,7 @@ class Results } $navigation = ''; - if (($displayParts['nav_bar'] == '1') && ! is_null($statement) && (empty($statement->limit))) { + if ($displayParts['nav_bar'] == '1' && ! is_null($statement) && empty($statement->limit)) { $navigation = $this->_getTableNavigation( $pos_next, $pos_prev, @@ -5272,7 +5272,7 @@ class Results if (! empty($analyzed_sql_results['statement']->expr)) { foreach ($analyzed_sql_results['statement']->expr as $expr) { - if (empty($expr->alias) || (empty($expr->column))) { + if (empty($expr->alias) || empty($expr->column)) { continue; } if (strcasecmp($meta->name, $expr->alias) == 0) { diff --git a/libraries/classes/Gis/GisGeometryCollection.php b/libraries/classes/Gis/GisGeometryCollection.php index 7d868f8a1f..28f5ddd29d 100644 --- a/libraries/classes/Gis/GisGeometryCollection.php +++ b/libraries/classes/Gis/GisGeometryCollection.php @@ -322,7 +322,7 @@ class GisGeometryCollection extends GisGeometry = mb_substr( $geom_col, $start, - ($count + 1 - $start) + $count + 1 - $start ); $start = $count + 2; } @@ -345,7 +345,7 @@ class GisGeometryCollection extends GisGeometry */ public function generateWkt(array $gis_data, $index, $empty = '') { - $geom_count = (isset($gis_data['GEOMETRYCOLLECTION']['geom_count'])) + $geom_count = isset($gis_data['GEOMETRYCOLLECTION']['geom_count']) ? $gis_data['GEOMETRYCOLLECTION']['geom_count'] : 1; $wkt = 'GEOMETRYCOLLECTION('; for ($i = 0; $i < $geom_count; $i++) { diff --git a/libraries/classes/Gis/GisPolygon.php b/libraries/classes/Gis/GisPolygon.php index 0a49dee452..c292f2f2c4 100644 --- a/libraries/classes/Gis/GisPolygon.php +++ b/libraries/classes/Gis/GisPolygon.php @@ -537,7 +537,7 @@ class GisPolygon extends GisGeometry // Always keep $epsilon < 1 to go with the reduction logic down here $epsilon = 0.1; - $denominator = sqrt(pow(($y1 - $y0), 2) + pow(($x0 - $x1), 2)); + $denominator = sqrt(pow($y1 - $y0, 2) + pow($x0 - $x1, 2)); $pointA = []; $pointB = []; diff --git a/libraries/classes/Header.php b/libraries/classes/Header.php index e8e988760e..5b1db8dbe1 100644 --- a/libraries/classes/Header.php +++ b/libraries/classes/Header.php @@ -256,7 +256,7 @@ class Header 'confirm' => $GLOBALS['cfg']['Confirm'], 'LoginCookieValidity' => $GLOBALS['cfg']['LoginCookieValidity'], 'session_gc_maxlifetime' => (int) ini_get('session.gc_maxlifetime'), - 'logged_in' => (isset($GLOBALS['dbi']) ? $GLOBALS['dbi']->isUserType('logged') : false), + 'logged_in' => isset($GLOBALS['dbi']) ? $GLOBALS['dbi']->isUserType('logged') : false, 'is_https' => $GLOBALS['PMA_Config']->isHttps(), 'rootPath' => $GLOBALS['PMA_Config']->getRootPath(), 'arg_separator' => Url::getArgSeparator(), diff --git a/libraries/classes/Import.php b/libraries/classes/Import.php index aa9d72c0c5..1fa743bee3 100644 --- a/libraries/classes/Import.php +++ b/libraries/classes/Import.php @@ -560,8 +560,8 @@ class Import { return (int) substr( $last_cumulative_size, - (strpos($last_cumulative_size, ",") + 1), - (strlen($last_cumulative_size) - strpos($last_cumulative_size, ",")) + strpos($last_cumulative_size, ",") + 1, + strlen($last_cumulative_size) - strpos($last_cumulative_size, ",") ); } @@ -586,7 +586,7 @@ class Import return [ $m, $d, - ($m . "," . $d), + $m . "," . $d, ]; } @@ -1145,11 +1145,11 @@ class Import $is_varchar = false; } - $tempSQLStr .= (($is_varchar) ? "'" : ""); + $tempSQLStr .= $is_varchar ? "'" : ""; $tempSQLStr .= $GLOBALS['dbi']->escapeString( (string) $tables[$i][self::ROWS][$j][$k] ); - $tempSQLStr .= (($is_varchar) ? "'" : ""); + $tempSQLStr .= $is_varchar ? "'" : ""; } if ($k != ($num_cols - 1)) { @@ -1398,7 +1398,7 @@ class Import if ((! (($statement instanceof UpdateStatement) || ($statement instanceof DeleteStatement))) - || (! empty($statement->join)) + || ! empty($statement->join) ) { $error = $error_msg; break; diff --git a/libraries/classes/Linter.php b/libraries/classes/Linter.php index 7738cee168..ff31bfac89 100644 --- a/libraries/classes/Linter.php +++ b/libraries/classes/Linter.php @@ -31,7 +31,8 @@ class Linter public static function getLines($str) { if ((! ($str instanceof UtfString)) - && (defined('USE_UTF_STRINGS')) && (USE_UTF_STRINGS) + && defined('USE_UTF_STRINGS') + && USE_UTF_STRINGS ) { // If the lexer uses UtfString for processing then the position will // represent the position of the character and not the position of diff --git a/libraries/classes/Menu.php b/libraries/classes/Menu.php index 433b1a6919..926bf735a4 100644 --- a/libraries/classes/Menu.php +++ b/libraries/classes/Menu.php @@ -512,7 +512,7 @@ class Menu $tabs['operation']['text'] = __('Operations'); $tabs['operation']['icon'] = 'b_tblops'; - if (($is_superuser || $isCreateOrGrantUser)) { + if ($is_superuser || $isCreateOrGrantUser) { $tabs['privileges']['link'] = 'server_privileges.php'; $tabs['privileges']['args']['checkprivsdb'] = $this->_db; // stay on database view diff --git a/libraries/classes/MultSubmits.php b/libraries/classes/MultSubmits.php index cb3b429076..2d0503d973 100644 --- a/libraries/classes/MultSubmits.php +++ b/libraries/classes/MultSubmits.php @@ -72,7 +72,7 @@ class MultSubmits ) { $urlParams = [ 'query_type' => $what, - 'reload' => (! empty($reload) ? 1 : 0), + 'reload' => ! empty($reload) ? 1 : 0, ]; if (mb_strpos(' ' . $action, 'db_') == 1) { $urlParams['db'] = $db; diff --git a/libraries/classes/Navigation/NavigationTree.php b/libraries/classes/Navigation/NavigationTree.php index d2cddc15be..c478cbe9a6 100644 --- a/libraries/classes/Navigation/NavigationTree.php +++ b/libraries/classes/Navigation/NavigationTree.php @@ -254,7 +254,7 @@ class NavigationTree } $navItems = (int) $GLOBALS['cfg']['FirstLevelNavigationItems']; - $retval = floor((count($prefixMap) / $navItems)) * $navItems; + $retval = floor(count($prefixMap) / $navItems) * $navItems; return $retval; } @@ -1071,7 +1071,7 @@ class NavigationTree // if node name itself is in sterile, then allow if ($node->is_group || (! in_array($parentName, $sterile) && ! $node->isNew) - || (in_array($node->real_name, $sterile)) + || in_array($node->real_name, $sterile) ) { $retval .= "
"; $iClass = ''; diff --git a/libraries/classes/Navigation/Nodes/NodeDatabaseChildContainer.php b/libraries/classes/Navigation/Nodes/NodeDatabaseChildContainer.php index 994de817b0..53853bffcd 100644 --- a/libraries/classes/Navigation/Nodes/NodeDatabaseChildContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeDatabaseChildContainer.php @@ -27,9 +27,7 @@ abstract class NodeDatabaseChildContainer extends NodeDatabaseChild parent::__construct($name, $type); if ($GLOBALS['cfg']['NavigationTreeEnableGrouping']) { $this->separator = $GLOBALS['cfg']['NavigationTreeTableSeparator']; - $this->separator_depth = (int) ( - $GLOBALS['cfg']['NavigationTreeTableLevel'] - ); + $this->separator_depth = (int) $GLOBALS['cfg']['NavigationTreeTableLevel']; } } diff --git a/libraries/classes/Plugins/Export/ExportSql.php b/libraries/classes/Plugins/Export/ExportSql.php index bd89b65766..eb1b00d63d 100644 --- a/libraries/classes/Plugins/Export/ExportSql.php +++ b/libraries/classes/Plugins/Export/ExportSql.php @@ -749,8 +749,8 @@ class ExportSql extends ExportPlugin // We want exported AUTO_INCREMENT columns to have still same value, // do this only for recent MySQL exports - if ((! isset($GLOBALS['sql_compatibility']) - || $GLOBALS['sql_compatibility'] == 'NONE') + if (! isset($GLOBALS['sql_compatibility']) + || $GLOBALS['sql_compatibility'] == 'NONE' ) { $head .= 'SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";' . $crlf; } @@ -1794,7 +1794,7 @@ class ExportSql extends ExportPlugin ) . $alter_footer; } - if (! empty($indexes) || (! empty($indexes_fulltext))) { + if (! empty($indexes) || ! empty($indexes_fulltext)) { $sql_indexes = $this->generateComment( $crlf, $sql_indexes, @@ -1813,7 +1813,7 @@ class ExportSql extends ExportPlugin } // Generating auto-increment-related query. - if (! empty($auto_increment) && ($update_indexes_increments)) { + if (! empty($auto_increment) && $update_indexes_increments) { $sql_auto_increments_query = $alter_header . $crlf . ' MODIFY ' . implode(',' . $crlf . ' MODIFY ', $auto_increment); if (isset($GLOBALS['sql_auto_increment']) @@ -2827,9 +2827,9 @@ class ExportSql extends ExportPlugin } if ($statement->options->has('TRIGGER') - || ($statement->options->has('PROCEDURE')) - || ($statement->options->has('FUNCTION')) - || ($statement->options->has('VIEW')) + || $statement->options->has('PROCEDURE') + || $statement->options->has('FUNCTION') + || $statement->options->has('VIEW') ) { // Repalcing the body. for ($i = 0, $count = count($statement->body); $i < $count; ++$i) { diff --git a/libraries/classes/Plugins/Export/ExportXml.php b/libraries/classes/Plugins/Export/ExportXml.php index 01a4e5d0b1..9696f519a7 100644 --- a/libraries/classes/Plugins/Export/ExportXml.php +++ b/libraries/classes/Plugins/Export/ExportXml.php @@ -253,7 +253,7 @@ class ExportXml extends ExportPlugin . '-->' . $crlf . $crlf; $head .= '' . $crlf; diff --git a/libraries/classes/Plugins/Export/Helpers/Pdf.php b/libraries/classes/Plugins/Export/Helpers/Pdf.php index 0601d2271c..73c57799c2 100644 --- a/libraries/classes/Plugins/Export/Helpers/Pdf.php +++ b/libraries/classes/Plugins/Export/Helpers/Pdf.php @@ -113,7 +113,7 @@ class Pdf extends PdfLib $current_page = $this->page; if ((($y + $h) > $this->PageBreakTrigger) && (! $this->InFooter) - && ($this->AcceptPageBreak()) + && $this->AcceptPageBreak() ) { if ($addpage) { //Automatic page break diff --git a/libraries/classes/Plugins/Import/ImportSql.php b/libraries/classes/Plugins/Import/ImportSql.php index f7e43f29ac..1dc62e5963 100644 --- a/libraries/classes/Plugins/Import/ImportSql.php +++ b/libraries/classes/Plugins/Import/ImportSql.php @@ -160,7 +160,7 @@ class ImportSql extends ImportPlugin } // Extracting remaining statements. - while ((! $error) && (! $timeout_passed) && (! empty($bq->query))) { + while (! $error && ! $timeout_passed && ! empty($bq->query)) { $statement = $bq->extract(true); if (! empty($statement)) { $this->import->runQuery($statement, $statement, $sql_data); diff --git a/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php b/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php index 47afe14b75..71a7ca24f6 100644 --- a/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php +++ b/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php @@ -768,18 +768,18 @@ class PdfRelationSchema extends ExportRelationSchema $field_name, $type, $attribute, - (($row['Null'] == '' || $row['Null'] == 'NO') + ($row['Null'] == '' || $row['Null'] == 'NO') ? __('No') - : __('Yes')), - (isset($row['Default']) ? $row['Default'] : ''), + : __('Yes'), + isset($row['Default']) ? $row['Default'] : '', $row['Extra'], $linksTo, - (isset($comments[$field_name]) + isset($comments[$field_name]) ? $comments[$field_name] - : ''), - (isset($mime_map) && isset($mime_map[$field_name]) + : '', + isset($mime_map) && isset($mime_map[$field_name]) ? str_replace('_', '/', $mime_map[$field_name]['mimetype']) - : ''), + : '', ]; $links = []; $links[0] = $this->diagram->PMA_links['RT'][$table][$field_name]; diff --git a/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php b/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php index ad7a91f972..b504cac82e 100644 --- a/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php +++ b/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php @@ -101,7 +101,7 @@ class Text_Plain_Iptobinary extends IOTransformationsPlugin . ' size="40"' . ' dir="' . $text_dir . '"' . ' class="' . $class . '"' - . ' id="field_' . ($idindex) . '_3"' + . ' id="field_' . $idindex . '_3"' . ' tabindex="' . ($tabindex + $tabindex_for_value) . '">'; return $html; diff --git a/libraries/classes/Relation.php b/libraries/classes/Relation.php index a9a2a13cfb..efa38381ea 100644 --- a/libraries/classes/Relation.php +++ b/libraries/classes/Relation.php @@ -91,7 +91,7 @@ class Relation public function getRelationsParam() { if (empty($_SESSION['relation'][$GLOBALS['server']]) - || (empty($_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'])) + || empty($_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION']) || $_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'] != PMA_VERSION ) { $_SESSION['relation'][$GLOBALS['server']] = $this->checkRelationsParam(); diff --git a/libraries/classes/ReplicationGui.php b/libraries/classes/ReplicationGui.php index eb284c5a65..1e3db907db 100644 --- a/libraries/classes/ReplicationGui.php +++ b/libraries/classes/ReplicationGui.php @@ -748,7 +748,7 @@ class ReplicationGui '', mb_substr( $_current_user, - (mb_strrpos($_current_user, '@') + 1) + mb_strrpos($_current_user, '@') + 1 ) ); if ($thishost != 'localhost' && $thishost != '127.0.0.1') { diff --git a/libraries/classes/Rte/Footer.php b/libraries/classes/Rte/Footer.php index fd11484677..98fc213684 100644 --- a/libraries/classes/Rte/Footer.php +++ b/libraries/classes/Rte/Footer.php @@ -125,12 +125,12 @@ class Footer 0 => [ 'label' => __('OFF'), 'value' => "SET GLOBAL event_scheduler=\"OFF\"", - 'selected' => ($es_state != 'on'), + 'selected' => $es_state != 'on', ], 1 => [ 'label' => __('ON'), 'value' => "SET GLOBAL event_scheduler=\"ON\"", - 'selected' => ($es_state == 'on'), + 'selected' => $es_state == 'on', ], ]; // Generate output diff --git a/libraries/classes/Rte/Routines.php b/libraries/classes/Rte/Routines.php index 16acf5f91e..8d3f6978e1 100644 --- a/libraries/classes/Rte/Routines.php +++ b/libraries/classes/Rte/Routines.php @@ -1599,7 +1599,7 @@ class Routines echo $form; } exit; - } elseif (($response->isAjax())) { + } elseif ($response->isAjax()) { $message = __('Error in processing request:') . ' '; $message .= sprintf( $this->words->get('not_found'), diff --git a/libraries/classes/Server/Privileges.php b/libraries/classes/Server/Privileges.php index 48c3164bdd..61f40ebd4c 100644 --- a/libraries/classes/Server/Privileges.php +++ b/libraries/classes/Server/Privileges.php @@ -782,12 +782,11 @@ class Privileges 'Does not require SSL-encrypted connections.' ), 'label' => 'REQUIRE NONE', - 'checked' => (isset($row['ssl_type']) + 'checked' => isset($row['ssl_type']) && ($row['ssl_type'] == 'NONE' || $row['ssl_type'] == '') ? 'checked="checked"' - : '' - ), + : '', 'disabled' => false, 'radio' => true, ], @@ -798,10 +797,9 @@ class Privileges 'Requires SSL-encrypted connections.' ), 'label' => 'REQUIRE SSL', - 'checked' => (isset($row['ssl_type']) && ($row['ssl_type'] == 'ANY') + 'checked' => isset($row['ssl_type']) && ($row['ssl_type'] == 'ANY') ? 'checked="checked"' - : '' - ), + : '', 'disabled' => false, 'radio' => true, ], @@ -812,10 +810,9 @@ class Privileges 'Requires a valid X509 certificate.' ), 'label' => 'REQUIRE X509', - 'checked' => (isset($row['ssl_type']) && ($row['ssl_type'] == 'X509') + 'checked' => isset($row['ssl_type']) && ($row['ssl_type'] == 'X509') ? 'checked="checked"' - : '' - ), + : '', 'disabled' => false, 'radio' => true, ], @@ -824,15 +821,14 @@ class Privileges 'value' => 'SPECIFIED', 'description' => '', 'label' => 'SPECIFIED', - 'checked' => ($specified ? 'checked="checked"' : ''), + 'checked' => $specified ? 'checked="checked"' : '', 'disabled' => false, 'radio' => true, ], [ 'name' => 'ssl_cipher', - 'value' => (isset($row['ssl_cipher']) - ? htmlspecialchars($row['ssl_cipher']) : '' - ), + 'value' => isset($row['ssl_cipher']) + ? htmlspecialchars($row['ssl_cipher']) : '', 'description' => __( 'Requires that a specific cipher method be used for a connection.' ), @@ -843,9 +839,8 @@ class Privileges ], [ 'name' => 'x509_issuer', - 'value' => (isset($row['x509_issuer']) - ? htmlspecialchars($row['x509_issuer']) : '' - ), + 'value' => isset($row['x509_issuer']) + ? htmlspecialchars($row['x509_issuer']) : '', 'description' => __( 'Requires that a valid X509 certificate issued by this CA be presented.' ), @@ -856,9 +851,8 @@ class Privileges ], [ 'name' => 'x509_subject', - 'value' => (isset($row['x509_subject']) - ? htmlspecialchars($row['x509_subject']) : '' - ), + 'value' => isset($row['x509_subject']) + ? htmlspecialchars($row['x509_subject']) : '', 'description' => __( 'Requires that a valid X509 certificate with this subject be presented.' ), @@ -887,7 +881,7 @@ class Privileges [ 'input_name' => 'max_questions', 'name_main' => 'MAX QUERIES PER HOUR', - 'value' => (isset($row['max_questions']) ? $row['max_questions'] : '0'), + 'value' => isset($row['max_questions']) ? $row['max_questions'] : '0', 'description' => __( 'Limits the number of queries the user may send to the server per hour.' ), @@ -895,7 +889,7 @@ class Privileges [ 'input_name' => 'max_updates', 'name_main' => 'MAX UPDATES PER HOUR', - 'value' => (isset($row['max_updates']) ? $row['max_updates'] : '0'), + 'value' => isset($row['max_updates']) ? $row['max_updates'] : '0', 'description' => __( 'Limits the number of commands that change any table ' . 'or database the user may execute per hour.' @@ -904,7 +898,7 @@ class Privileges [ 'input_name' => 'max_connections', 'name_main' => 'MAX CONNECTIONS PER HOUR', - 'value' => (isset($row['max_connections']) ? $row['max_connections'] : '0'), + 'value' => isset($row['max_connections']) ? $row['max_connections'] : '0', 'description' => __( 'Limits the number of new connections the user may open per hour.' ), @@ -912,8 +906,8 @@ class Privileges [ 'input_name' => 'max_user_connections', 'name_main' => 'MAX USER_CONNECTIONS', - 'value' => (isset($row['max_user_connections']) ? - $row['max_user_connections'] : '0'), + 'value' => isset($row['max_user_connections']) ? + $row['max_user_connections'] : '0', 'description' => __( 'Limits the number of simultaneous connections ' . 'the user may have.' @@ -1184,7 +1178,7 @@ class Privileges . mb_substr( $tmp_current_grant, 0, - (mb_strlen($tmp_current_grant) - 5) + mb_strlen($tmp_current_grant) - 5 ); $html_output .= (isset($GLOBALS[$privGlobalName]) ? $GLOBALS[$privGlobalName] @@ -1340,10 +1334,9 @@ class Privileges [ 'Create', 'CREATE', - ($table == '*' + $table == '*' ? __('Allows creating new databases and tables.') - : __('Allows creating new tables.') - ), + : __('Allows creating new tables.'), ], [ 'Alter', @@ -1358,10 +1351,9 @@ class Privileges [ 'Drop', 'DROP', - ($table == '*' + $table == '*' ? __('Allows dropping databases and tables.') - : __('Allows dropping tables.') - ), + : __('Allows dropping tables.'), ], [ 'Create_tmp_table', @@ -1698,7 +1690,7 @@ class Privileges '', mb_substr( $_current_user, - (mb_strrpos($_current_user, '@') + 1) + mb_strrpos($_current_user, '@') + 1 ) ); if ($thishost != 'localhost' && $thishost != '127.0.0.1') { @@ -3149,7 +3141,7 @@ class Privileges } $new_user_string .= ''; - if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y')) { + if (isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') { $new_user_string .= __('Yes'); } else { $new_user_string .= __('No'); @@ -4336,7 +4328,7 @@ class Privileges $_user_name = $this->dbi->fetchValue('SELECT USER()'); $hostname = mb_substr( $_user_name, - (mb_strrpos($_user_name, '@') + 1) + mb_strrpos($_user_name, '@') + 1 ); unset($_user_name); break; diff --git a/libraries/classes/Server/Status/Data.php b/libraries/classes/Server/Status/Data.php index 62336d4982..078ff0c899 100644 --- a/libraries/classes/Server/Status/Data.php +++ b/libraries/classes/Server/Status/Data.php @@ -206,7 +206,7 @@ class Data ]; $links['innodb']['doc'] = 'innodb'; - return($links); + return $links; } /** diff --git a/libraries/classes/Server/Status/Processes.php b/libraries/classes/Server/Status/Processes.php index bfd1e103e6..6926d76082 100644 --- a/libraries/classes/Server/Status/Processes.php +++ b/libraries/classes/Server/Status/Processes.php @@ -133,7 +133,7 @@ class Processes : 'SHOW PROCESSLIST'; if ((! empty($_POST['order_by_field']) && ! empty($_POST['sort_order'])) - || (! empty($_POST['showExecuting'])) + || ! empty($_POST['showExecuting']) ) { $sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` '; } @@ -241,11 +241,11 @@ class Processes $url_params = [ 'ajax_request' => true, - 'full' => (isset($_POST['full']) ? $_POST['full'] : ''), - 'column_name' => (isset($_POST['column_name']) ? $_POST['column_name'] : ''), + 'full' => isset($_POST['full']) ? $_POST['full'] : '', + 'column_name' => isset($_POST['column_name']) ? $_POST['column_name'] : '', 'order_by_field' - => (isset($_POST['order_by_field']) ? $_POST['order_by_field'] : ''), - 'sort_order' => (isset($_POST['sort_order']) ? $_POST['sort_order'] : ''), + => isset($_POST['order_by_field']) ? $_POST['order_by_field'] : '', + 'sort_order' => isset($_POST['sort_order']) ? $_POST['sort_order'] : '', ]; $retval = ''; @@ -280,7 +280,7 @@ class Processes // Array keys need to modify due to the way it has used // to display column values if ((! empty($_POST['order_by_field']) && ! empty($_POST['sort_order'])) - || (! empty($_POST['showExecuting'])) + || ! empty($_POST['showExecuting']) ) { foreach (array_keys($process) as $key) { $new_key = ucfirst(mb_strtolower($key)); diff --git a/libraries/classes/Sql.php b/libraries/classes/Sql.php index 982ae666c0..da5d89b677 100644 --- a/libraries/classes/Sql.php +++ b/libraries/classes/Sql.php @@ -526,7 +526,7 @@ class Sql && $analyzed_sql_results['select_from'] && isset($analyzed_sql_results['select_expr']) && isset($analyzed_sql_results['select_tables']) - && ((empty($analyzed_sql_results['select_expr'])) + && (empty($analyzed_sql_results['select_expr']) || ((count($analyzed_sql_results['select_expr']) == 1) && ($analyzed_sql_results['select_expr'][0] == '*'))) && count($analyzed_sql_results['select_tables']) == 1; @@ -979,7 +979,7 @@ class Sql private function getNumberOfRowsAffectedOrChanged($is_affected, $result) { if (! $is_affected) { - $num_rows = ($result) ? @$GLOBALS['dbi']->numRows($result) : 0; + $num_rows = $result ? @$GLOBALS['dbi']->numRows($result) : 0; } else { $num_rows = @$GLOBALS['dbi']->affectedRows(); } diff --git a/libraries/classes/Tracker.php b/libraries/classes/Tracker.php index bf44b6b8dc..b846f892c1 100644 --- a/libraries/classes/Tracker.php +++ b/libraries/classes/Tracker.php @@ -287,7 +287,7 @@ class Tracker if ($result) { // Deactivate previous version - self::deactivateTracking($dbname, $tablename, ($version - 1)); + self::deactivateTracking($dbname, $tablename, $version - 1); } return $result; diff --git a/libraries/classes/Tracking.php b/libraries/classes/Tracking.php index 1244f1ae83..3c78a3e4c1 100644 --- a/libraries/classes/Tracking.php +++ b/libraries/classes/Tracking.php @@ -80,7 +80,7 @@ class Tracking } $id++; } - return($tmp_entries); + return $tmp_entries; } /** @@ -175,7 +175,7 @@ class Tracking ) { $selectableTablesSqlResult = $this->getSqlResultForSelectableTables(); $selectableTablesEntries = []; - while (($entry = $GLOBALS['dbi']->fetchArray($selectableTablesSqlResult))) { + while ($entry = $GLOBALS['dbi']->fetchArray($selectableTablesSqlResult)) { $entry['is_tracked'] = Tracker::isTracked( $entry['db_name'], $entry['table_name'] @@ -649,7 +649,7 @@ class Tracking $entry['url_params'] = Url::getCommon($urlParams + [ 'report' => 'true', 'version' => $_POST['version'], - $deleteParam => ($lineNumber - $offset), + $deleteParam => $lineNumber - $offset, ], ''); $entry['line_number'] = $lineNumber; $entries[] = $entry; @@ -1256,7 +1256,7 @@ class Tracking $sep = $GLOBALS['cfg']['NavigationTreeTableSeparator']; foreach ($table_list as $key => $value) { - if (is_array($value) && array_key_exists(('is' . $sep . 'group'), $value) + if (is_array($value) && array_key_exists('is' . $sep . 'group', $value) && $value['is' . $sep . 'group'] ) { $untracked_tables = array_merge($this->extractTableNames($value, $db), $untracked_tables); //Recursion step @@ -1299,12 +1299,12 @@ class Tracking 0 => [ 'label' => __('not active'), 'value' => 'deactivate_now', - 'selected' => ($state != 'active'), + 'selected' => $state != 'active', ], 1 => [ 'label' => __('active'), 'value' => 'activate_now', - 'selected' => ($state == 'active'), + 'selected' => $state == 'active', ], ]; $link = 'tbl_tracking.php' . $urlQuery . '&table=' diff --git a/libraries/classes/UserPassword.php b/libraries/classes/UserPassword.php index eb47a16e6e..7c57844089 100644 --- a/libraries/classes/UserPassword.php +++ b/libraries/classes/UserPassword.php @@ -78,7 +78,7 @@ class UserPassword $error = false; $message = Message::success(__('The profile has been updated.')); - if (($_POST['nopass'] != '1')) { + if ($_POST['nopass'] != '1') { if (strlen($_POST['pma_pw']) === 0 || strlen($_POST['pma_pw2']) === 0) { $message = Message::error(__('The password is empty!')); $error = true; diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index e79dd3b7b2..c20230460d 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -564,7 +564,7 @@ class Util } // Finding the query that failed, if not specified. - if ((empty($sql_query) && (! empty($GLOBALS['sql_query'])))) { + if (empty($sql_query) && ! empty($GLOBALS['sql_query'])) { $sql_query = $GLOBALS['sql_query']; } $sql_query = trim($sql_query); @@ -599,7 +599,7 @@ class Util // For security reasons, if the MySQL refuses the connection, the query // is hidden so no details are revealed. - if ((! empty($sql_query)) && (! (mb_strstr($sql_query, 'connect')))) { + if (! empty($sql_query) && ! mb_strstr($sql_query, 'connect')) { // Static analysis errors. if (! empty($errors)) { $error_msg .= '

' . __('Static analysis:') @@ -1488,7 +1488,7 @@ class Util if ($originalValue != 0 && floatval($value) == 0) { return ' <' . number_format( - (1 / pow(10, $digits_right)), + 1 / pow(10, $digits_right), $digits_right, $decimal_sep, $thousands_sep @@ -1999,7 +1999,7 @@ class Util if (! empty($analyzed_sql_results['statement']->expr)) { foreach ($analyzed_sql_results['statement']->expr as $expr) { - if ((empty($expr->alias)) || (empty($expr->column))) { + if (empty($expr->alias) || empty($expr->column)) { continue; } if (strcasecmp($meta->name, $expr->alias) == 0) { @@ -2130,7 +2130,7 @@ class Util } $where_clause = trim(preg_replace('|\s?AND$|', '', $preferred_condition)); - return([$where_clause, $clause_is_unique, $condition_array]); + return [$where_clause, $clause_is_unique, $condition_array]; } // end function /** @@ -4625,7 +4625,7 @@ class Util $GLOBALS['dbi']->getTablesFull( $db, $groupWithSeparator, - ($groupWithSeparator !== false), + $groupWithSeparator !== false, $limit_offset, $limit_count, $sort, diff --git a/libraries/classes/ZipExtension.php b/libraries/classes/ZipExtension.php index 0dfb01de4f..a985e06fac 100644 --- a/libraries/classes/ZipExtension.php +++ b/libraries/classes/ZipExtension.php @@ -57,7 +57,7 @@ class ZipExtension if ($this->zip->numFiles === 0) { $error_message = __('No files found inside ZIP archive!'); $this->zip->close(); - return (['error' => $error_message, 'data' => $file_data]); + return ['error' => $error_message, 'data' => $file_data]; } /* Is the the zip really an ODS file? */ @@ -70,7 +70,7 @@ class ZipExtension if (! isset($specific_entry)) { $file_data = $first_zip_entry; $this->zip->close(); - return (['error' => $error_message, 'data' => $file_data]); + return ['error' => $error_message, 'data' => $file_data]; } /* Return the correct contents, not just the first entry */ @@ -88,11 +88,11 @@ class ZipExtension } $this->zip->close(); - return (['error' => $error_message, 'data' => $file_data]); + return ['error' => $error_message, 'data' => $file_data]; } else { $error_message = __('Error in ZIP archive:') . ' ' . $this->zip->getStatusString(); $this->zip->close(); - return (['error' => $error_message, 'data' => $file_data]); + return ['error' => $error_message, 'data' => $file_data]; } } diff --git a/libraries/tbl_columns_definition_form.inc.php b/libraries/tbl_columns_definition_form.inc.php index 5d3d86a123..78b67eb5af 100644 --- a/libraries/tbl_columns_definition_form.inc.php +++ b/libraries/tbl_columns_definition_form.inc.php @@ -504,9 +504,8 @@ $html = $template->render('columns_definitions/column_definitions_form', [ 'max_rows' => intval($GLOBALS['cfg']['MaxRows']), 'char_editing' => isset($GLOBALS['cfg']['CharEditing']) ? $GLOBALS['cfg']['CharEditing'] : null, 'attribute_types' => $GLOBALS['dbi']->types->getAttributes(), - 'privs_available' => (isset($GLOBALS['col_priv']) ? $GLOBALS['col_priv'] : false - && isset($GLOBALS['is_reload_priv']) ? $GLOBALS['is_reload_priv'] : false - ), + 'privs_available' => isset($GLOBALS['col_priv']) ? $GLOBALS['col_priv'] : false + && isset($GLOBALS['is_reload_priv']) ? $GLOBALS['is_reload_priv'] : false, 'max_length' => $GLOBALS['dbi']->getVersion() >= 50503 ? 1024 : 255, 'have_partitioning' => Partition::havePartitioning(), 'dbi' => $GLOBALS['dbi'], diff --git a/libraries/user_preferences.inc.php b/libraries/user_preferences.inc.php index 921506c423..5e8e0d0c1d 100644 --- a/libraries/user_preferences.inc.php +++ b/libraries/user_preferences.inc.php @@ -47,7 +47,7 @@ foreach (UserFormList::getAll() as $formset) { 'link' => 'prefs_forms.php', 'text' => $formset_class::getName(), 'icon' => $tabs_icons[$formset], - 'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param), + 'active' => $script_name == 'prefs_forms.php' && $formset == $form_param, ]; $content .= Util::getHtmlTab($tab, ['form' => $formset]) . "\n"; } diff --git a/tbl_export.php b/tbl_export.php index 68c7c47dc6..c815b99986 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -56,14 +56,14 @@ $export_page_title = __('View dump (schema) of table'); if (! empty($sql_query)) { $parser = new PhpMyAdmin\SqlParser\Parser($sql_query); - if ((! empty($parser->statements[0])) + if (! empty($parser->statements[0]) && ($parser->statements[0] instanceof PhpMyAdmin\SqlParser\Statements\SelectStatement) ) { // Finding aliases and removing them, but we keep track of them to be // able to replace them in select expression too. $aliases = []; foreach ($parser->statements[0]->from as $from) { - if ((! empty($from->table)) && (! empty($from->alias))) { + if (! empty($from->table) && ! empty($from->alias)) { $aliases[$from->alias] = $from->table; // We remove the alias of the table because they are going to // be replaced anyway. @@ -87,7 +87,7 @@ if (! empty($sql_query)) { } // Checking if the WHERE clause has to be replaced. - if ((! empty($where_clause)) && (is_array($where_clause))) { + if (! empty($where_clause) && is_array($where_clause)) { $replaces[] = [ 'WHERE', 'WHERE (' . implode(') OR (', $where_clause) . ')', diff --git a/tbl_operations.php b/tbl_operations.php index 8bc2e4968d..08d0fc653b 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -93,7 +93,7 @@ if ($pma_table->isEngine('ARIA')) { $create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'; - $create_options['page_checksum'] = (isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''; + $create_options['page_checksum'] = isset($create_options['page_checksum']) ? $create_options['page_checksum'] : ''; } $pma_table = $GLOBALS['dbi']->getTable( @@ -166,13 +166,13 @@ if (isset($_POST['submitoptions'])) { $create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'; - $create_options['page_checksum'] = (isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''; + $create_options['page_checksum'] = isset($create_options['page_checksum']) ? $create_options['page_checksum'] : ''; } } else { $new_tbl_storage_engine = ''; } - $row_format = (isset($create_options['row_format'])) + $row_format = isset($create_options['row_format']) ? $create_options['row_format'] : $pma_table->getRowFormat(); @@ -180,7 +180,7 @@ if (isset($_POST['submitoptions'])) { $pma_table, $create_options['pack_keys'], (empty($create_options['checksum']) ? '0' : '1'), - ((isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''), + (isset($create_options['page_checksum']) ? $create_options['page_checksum'] : ''), (empty($create_options['delay_key_write']) ? '0' : '1'), $row_format, $new_tbl_storage_engine, @@ -388,7 +388,7 @@ $response->addHTML( $auto_increment, (empty($create_options['delay_key_write']) ? '0' : '1'), ((isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'), - ((isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''), + (isset($create_options['page_checksum']) ? $create_options['page_checksum'] : ''), (empty($create_options['checksum']) ? '0' : '1') ) ); diff --git a/version_check.php b/version_check.php index 60bcdb3fe6..15074c3cd3 100644 --- a/version_check.php +++ b/version_check.php @@ -42,8 +42,8 @@ if (empty($versionDetails)) { } echo json_encode( [ - 'version' => (! empty($version) ? $version : ''), - 'date' => (! empty($date) ? $date : ''), + 'version' => ! empty($version) ? $version : '', + 'date' => ! empty($date) ? $date : '', ] ); }