diff --git a/libraries/classes/Command/CacheWarmupCommand.php b/libraries/classes/Command/CacheWarmupCommand.php index b326a9399f..c73b62ac3c 100644 --- a/libraries/classes/Command/CacheWarmupCommand.php +++ b/libraries/classes/Command/CacheWarmupCommand.php @@ -53,9 +53,13 @@ final class CacheWarmupCommand extends Command $output->writeln('Please specify --twig or --routing'); return 1; - } elseif ($input->getOption('twig') === true) { + } + + if ($input->getOption('twig') === true) { return $this->warmUpTwigCache($output); - } elseif ($input->getOption('routing') === true) { + } + + if ($input->getOption('routing') === true) { return $this->warmUpRoutingCache($output); } diff --git a/libraries/classes/Controllers/Database/CentralColumnsController.php b/libraries/classes/Controllers/Database/CentralColumnsController.php index 223dbbeb3b..d76bb97821 100644 --- a/libraries/classes/Controllers/Database/CentralColumnsController.php +++ b/libraries/classes/Controllers/Database/CentralColumnsController.php @@ -54,7 +54,9 @@ class CentralColumnsController extends AbstractController ]); return; - } elseif (isset($_POST['add_new_column'])) { + } + + if (isset($_POST['add_new_column'])) { $tmp_msg = $this->addNewColumn([ 'col_name' => $_POST['col_name'] ?? null, 'col_default' => $_POST['col_default'] ?? null, diff --git a/libraries/classes/Controllers/Preferences/ManageController.php b/libraries/classes/Controllers/Preferences/ManageController.php index 5d1b17f934..246d083f7e 100644 --- a/libraries/classes/Controllers/Preferences/ManageController.php +++ b/libraries/classes/Controllers/Preferences/ManageController.php @@ -82,7 +82,9 @@ class ManageController extends AbstractController echo json_encode($settings['config_data'], JSON_PRETTY_PRINT); return; - } elseif (isset($_POST['submit_export'], $_POST['export_type']) && $_POST['export_type'] == 'php_file') { + } + + if (isset($_POST['submit_export'], $_POST['export_type']) && $_POST['export_type'] == 'php_file') { // export to JSON file $this->response->disable(); $filename = 'phpMyAdmin-config-' . urlencode(Core::getenv('HTTP_HOST')) . '.php'; @@ -96,13 +98,17 @@ class ManageController extends AbstractController } return; - } elseif (isset($_POST['submit_get_json'])) { + } + + if (isset($_POST['submit_get_json'])) { $settings = $this->userPreferences->load(); $this->response->addJSON('prefs', json_encode($settings['config_data'])); $this->response->addJSON('mtime', $settings['mtime']); return; - } elseif (isset($_POST['submit_import'])) { + } + + if (isset($_POST['submit_import'])) { // load from JSON file $json = ''; if (isset($_POST['import_type'], $_FILES['import_file']) diff --git a/libraries/classes/Controllers/Table/OperationsController.php b/libraries/classes/Controllers/Table/OperationsController.php index 3730b5145e..60e11cffc4 100644 --- a/libraries/classes/Controllers/Table/OperationsController.php +++ b/libraries/classes/Controllers/Table/OperationsController.php @@ -381,7 +381,9 @@ class OperationsController extends AbstractController if ($name == 'PRIMARY') { $hideOrderTable = true; break; - } elseif (! $idx->getNonUnique()) { + } + + if (! $idx->getNonUnique()) { $notNull = true; foreach ($idx->getColumns() as $column) { if ($column->getNull()) { diff --git a/libraries/classes/Controllers/Table/ReplaceController.php b/libraries/classes/Controllers/Table/ReplaceController.php index 8e8eb59a43..0a297f8b94 100644 --- a/libraries/classes/Controllers/Table/ReplaceController.php +++ b/libraries/classes/Controllers/Table/ReplaceController.php @@ -401,19 +401,25 @@ final class ReplaceController extends AbstractController $controller->index(); return; - } elseif ($goto_include === '/database/sql') { + } + + if ($goto_include === '/database/sql') { /** @var DatabaseSqlController $controller */ $controller = $containerBuilder->get(DatabaseSqlController::class); $controller->index(); return; - } elseif ($goto_include === '/table/change') { + } + + if ($goto_include === '/table/change') { /** @var ChangeController $controller */ $controller = $containerBuilder->get(ChangeController::class); $controller->index(); return; - } elseif ($goto_include === '/table/sql') { + } + + if ($goto_include === '/table/sql') { /** @var TableSqlController $controller */ $controller = $containerBuilder->get(TableSqlController::class); $controller->index(); @@ -604,19 +610,25 @@ final class ReplaceController extends AbstractController $controller->index(); return; - } elseif ($goto_include === '/database/sql') { + } + + if ($goto_include === '/database/sql') { /** @var DatabaseSqlController $controller */ $controller = $containerBuilder->get(DatabaseSqlController::class); $controller->index(); return; - } elseif ($goto_include === '/table/change') { + } + + if ($goto_include === '/table/change') { /** @var ChangeController $controller */ $controller = $containerBuilder->get(ChangeController::class); $controller->index(); return; - } elseif ($goto_include === '/table/sql') { + } + + if ($goto_include === '/table/sql') { /** @var TableSqlController $controller */ $controller = $containerBuilder->get(TableSqlController::class); $controller->index(); diff --git a/libraries/classes/Database/Qbe.php b/libraries/classes/Database/Qbe.php index f82092ecdf..9cafeca00e 100644 --- a/libraries/classes/Database/Qbe.php +++ b/libraries/classes/Database/Qbe.php @@ -1800,7 +1800,9 @@ class Qbe $candidate_columns, $needsort, ]; - } elseif (isset($index_columns) && count($index_columns) > 0) { + } + + if (isset($index_columns) && count($index_columns) > 0) { $candidate_columns = $index_columns; $needsort = 1; @@ -1808,7 +1810,9 @@ class Qbe $candidate_columns, $needsort, ]; - } elseif (isset($where_clause_columns) && count($where_clause_columns) > 0) { + } + + if (isset($where_clause_columns) && count($where_clause_columns) > 0) { $candidate_columns = $where_clause_columns; $needsort = 0; diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index 17e6158c6f..d75baf4b5e 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -1202,7 +1202,9 @@ class DatabaseInterface implements DbalInterface } return $columns; - } elseif ($table === null) { + } + + if ($table === null) { $tables = $this->getTables($database); foreach ($tables as $table) { $columns[$table] = $this->getColumnsFull( @@ -2662,7 +2664,9 @@ class DatabaseInterface implements DbalInterface ); return false; - } elseif ($mode == self::CONNECT_AUXILIARY) { + } + + if ($mode == self::CONNECT_AUXILIARY) { // Do not go back to main login if connection failed // (currently used only in unit testing) return false; diff --git a/libraries/classes/ErrorHandler.php b/libraries/classes/ErrorHandler.php index e36d9f40e5..66e3407d5f 100644 --- a/libraries/classes/ErrorHandler.php +++ b/libraries/classes/ErrorHandler.php @@ -100,7 +100,9 @@ class ErrorHandler ); $_SESSION['errors'][$error->getHash()] = $error; break; - } elseif (($error instanceof Error) + } + + if (($error instanceof Error) && ! $error->isDisplayed() ) { $_SESSION['errors'][$key] = $error; diff --git a/libraries/classes/File.php b/libraries/classes/File.php index d42b695ebc..8c68c499c4 100644 --- a/libraries/classes/File.php +++ b/libraries/classes/File.php @@ -461,7 +461,9 @@ class File $this->_error_message = null; return true; - } elseif ($this->setSelectedFromTblChangeRequest($key, $rownumber)) { + } + + if ($this->setSelectedFromTblChangeRequest($key, $rownumber)) { // well done ... $this->_error_message = null; diff --git a/libraries/classes/Gis/GisVisualization.php b/libraries/classes/Gis/GisVisualization.php index efe13d0a0b..a854937252 100644 --- a/libraries/classes/Gis/GisVisualization.php +++ b/libraries/classes/Gis/GisVisualization.php @@ -542,9 +542,13 @@ class GisVisualization { if ($format == 'svg') { return $this->asSVG(); - } elseif ($format == 'png') { + } + + if ($format == 'png') { return $this->asPng(); - } elseif ($format == 'ol') { + } + + if ($format == 'ol') { return $this->asOl(); } diff --git a/libraries/classes/Git.php b/libraries/classes/Git.php index ca11148b2c..e588cf630f 100644 --- a/libraries/classes/Git.php +++ b/libraries/classes/Git.php @@ -107,7 +107,9 @@ class Git $_SESSION['is_git_revision'] = false; return false; - } elseif (@is_dir($gitmatch[1])) { + } + + if (@is_dir($gitmatch[1])) { //Detected git external folder location $git_location = $gitmatch[1]; } else { diff --git a/libraries/classes/Import.php b/libraries/classes/Import.php index 10f7230ce6..a6b5fe5dcd 100644 --- a/libraries/classes/Import.php +++ b/libraries/classes/Import.php @@ -88,11 +88,15 @@ class Import global $timestamp, $maximum_time, $timeout_passed; if ($maximum_time == 0) { return false; - } elseif ($timeout_passed) { + } + + if ($timeout_passed) { return true; /* 5 in next row might be too much */ - } elseif (time() - $timestamp > $maximum_time - 5) { + } + + if (time() - $timestamp > $maximum_time - 5) { $timeout_passed = true; return true; @@ -465,7 +469,9 @@ class Import return substr($contents, 3); // UTF-16 BE, LE - } elseif (strncmp($contents, "\xFE\xFF", 2) === 0 + } + + if (strncmp($contents, "\xFE\xFF", 2) === 0 || strncmp($contents, "\xFF\xFE", 2) === 0 ) { return substr($contents, 2); @@ -667,7 +673,9 @@ class Import */ if (! strcmp('NULL', $cell)) { return $last_cumulative_size; - } elseif ($curr_type == self::VARCHAR) { + } + + if ($curr_type == self::VARCHAR) { /** * What to do if the current cell is of type VARCHAR */ @@ -680,7 +688,9 @@ class Import } return $last_cumulative_size; - } elseif ($last_cumulative_type == self::DECIMAL) { + } + + if ($last_cumulative_type == self::DECIMAL) { /** * The last cumulative type was DECIMAL */ @@ -691,7 +701,9 @@ class Import } return $oldM; - } elseif ($last_cumulative_type == self::BIGINT || $last_cumulative_type == self::INT) { + } + + if ($last_cumulative_type == self::BIGINT || $last_cumulative_type == self::INT) { /** * The last cumulative type was BIGINT or INT */ @@ -700,7 +712,9 @@ class Import } return $last_cumulative_size; - } elseif (! isset($last_cumulative_type) || $last_cumulative_type == self::NONE) { + } + + if (! isset($last_cumulative_type) || $last_cumulative_type == self::NONE) { /** * This is the first row to be analyzed */ @@ -715,7 +729,9 @@ class Import */ return -1; - } elseif ($curr_type == self::DECIMAL) { + } + + if ($curr_type == self::DECIMAL) { /** * What to do if the current cell is of type DECIMAL */ @@ -731,7 +747,9 @@ class Import } return $last_cumulative_size; - } elseif ($last_cumulative_type == self::DECIMAL) { + } + + if ($last_cumulative_type == self::DECIMAL) { /** * The last cumulative type was DECIMAL */ @@ -748,7 +766,9 @@ class Import } return $last_cumulative_size; - } elseif ($last_cumulative_type == self::BIGINT || $last_cumulative_type == self::INT) { + } + + if ($last_cumulative_type == self::BIGINT || $last_cumulative_type == self::INT) { /** * The last cumulative type was BIGINT or INT */ @@ -760,7 +780,9 @@ class Import } return $last_cumulative_size . ',' . $size[self::D]; - } elseif (! isset($last_cumulative_type) || $last_cumulative_type == self::NONE) { + } + + if (! isset($last_cumulative_type) || $last_cumulative_type == self::NONE) { /** * This is the first row to be analyzed */ @@ -778,7 +800,9 @@ class Import */ return -1; - } elseif ($curr_type == self::BIGINT || $curr_type == self::INT) { + } + + if ($curr_type == self::BIGINT || $curr_type == self::INT) { /** * What to do if the current cell is of type BIGINT or INT */ @@ -791,7 +815,9 @@ class Import } return $last_cumulative_size; - } elseif ($last_cumulative_type == self::DECIMAL) { + } + + if ($last_cumulative_type == self::DECIMAL) { /** * The last cumulative type was DECIMAL */ @@ -808,7 +834,9 @@ class Import /* Use $newInt + $oldD as new M */ return ($newInt + $oldD) . ',' . $oldD; - } elseif ($last_cumulative_type == self::BIGINT || $last_cumulative_type == self::INT) { + } + + if ($last_cumulative_type == self::BIGINT || $last_cumulative_type == self::INT) { /** * The last cumulative type was BIGINT or INT */ @@ -817,7 +845,9 @@ class Import } return $last_cumulative_size; - } elseif (! isset($last_cumulative_type) || $last_cumulative_type == self::NONE) { + } + + if (! isset($last_cumulative_type) || $last_cumulative_type == self::NONE) { /** * This is the first row to be analyzed */ diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php index 4637b5dc2a..bf81c9379c 100644 --- a/libraries/classes/InsertEdit.php +++ b/libraries/classes/InsertEdit.php @@ -1581,7 +1581,9 @@ class InsertEdit if ($files === false) { return '' . __('Error') . '
' . "\n" . __('The directory you set for upload work cannot be reached.') . "\n"; - } elseif (! empty($files)) { + } + + if (! empty($files)) { return "
\n" . '' . __('Or') . ' ' . __('web server upload directory:') . '
' . "\n" @@ -2653,16 +2655,22 @@ class InsertEdit ) { if (empty($multi_edit_funcs[$key])) { return $current_value; - } elseif ($multi_edit_funcs[$key] === 'PHP_PASSWORD_HASH') { + } + + if ($multi_edit_funcs[$key] === 'PHP_PASSWORD_HASH') { $hash = password_hash($current_value, PASSWORD_DEFAULT); return "'" . $hash . "'"; - } elseif ($multi_edit_funcs[$key] === 'UUID') { + } + + if ($multi_edit_funcs[$key] === 'UUID') { /* This way user will know what UUID new row has */ $uuid = $this->dbi->fetchValue('SELECT UUID()'); return "'" . $uuid . "'"; - } elseif ((in_array($multi_edit_funcs[$key], $gis_from_text_functions) + } + + if ((in_array($multi_edit_funcs[$key], $gis_from_text_functions) && substr($current_value, 0, 3) == "'''") || in_array($multi_edit_funcs[$key], $gis_from_wkb_functions) ) { @@ -2672,7 +2680,9 @@ class InsertEdit $current_value = str_replace("''", "'", $current_value); return $multi_edit_funcs[$key] . '(' . $current_value . ')'; - } elseif (! in_array($multi_edit_funcs[$key], $func_no_param) + } + + if (! in_array($multi_edit_funcs[$key], $func_no_param) || ($current_value != "''" && in_array($multi_edit_funcs[$key], $func_optional_param)) ) { diff --git a/libraries/classes/Navigation/Navigation.php b/libraries/classes/Navigation/Navigation.php index 0f8a96fc49..7d92b02acf 100644 --- a/libraries/classes/Navigation/Navigation.php +++ b/libraries/classes/Navigation/Navigation.php @@ -270,7 +270,9 @@ class Navigation if (isset($pmaThemeImage) && @file_exists($pmaThemeImage . 'logo_left.png')) { return $pmaThemeImage . 'logo_left.png'; - } elseif (isset($pmaThemeImage) && @file_exists($pmaThemeImage . 'pma_logo2.png')) { + } + + if (isset($pmaThemeImage) && @file_exists($pmaThemeImage . 'pma_logo2.png')) { return $pmaThemeImage . 'pma_logo2.png'; } diff --git a/libraries/classes/Navigation/Nodes/Node.php b/libraries/classes/Navigation/Nodes/Node.php index 9762dd8158..9b45f8872a 100644 --- a/libraries/classes/Navigation/Nodes/Node.php +++ b/libraries/classes/Navigation/Nodes/Node.php @@ -789,7 +789,9 @@ class Node if (! $GLOBALS['cfg']['NavigationTreeEnableExpansion'] ) { return ''; - } elseif ($match) { + } + + if ($match) { $this->visible = true; return Generator::getImage('b_minus'); diff --git a/libraries/classes/Plugins/AuthenticationPlugin.php b/libraries/classes/Plugins/AuthenticationPlugin.php index 7a42766354..380713e35a 100644 --- a/libraries/classes/Plugins/AuthenticationPlugin.php +++ b/libraries/classes/Plugins/AuthenticationPlugin.php @@ -187,9 +187,13 @@ abstract class AuthenticationPlugin 'Login without a password is forbidden by configuration' . ' (see AllowNoPassword)' ); - } elseif ($failure == 'root-denied' || $failure == 'allow-denied') { + } + + if ($failure == 'root-denied' || $failure == 'allow-denied') { return __('Access denied!'); - } elseif ($failure == 'no-activity') { + } + + if ($failure == 'no-activity') { return sprintf( __('You have been automatically logged out due to inactivity of %s seconds.' . ' Once you log in again, you should be able to resume the work where you left off.'), @@ -200,7 +204,9 @@ abstract class AuthenticationPlugin $dbi_error = $GLOBALS['dbi']->getError(); if (! empty($dbi_error)) { return htmlspecialchars($dbi_error); - } elseif (isset($GLOBALS['errno'])) { + } + + if (isset($GLOBALS['errno'])) { return '#' . $GLOBALS['errno'] . ' ' . __('Cannot log in to the MySQL server'); } diff --git a/libraries/classes/Plugins/Import/ImportCsv.php b/libraries/classes/Plugins/Import/ImportCsv.php index ce07fd3c24..d1cd45b57a 100644 --- a/libraries/classes/Plugins/Import/ImportCsv.php +++ b/libraries/classes/Plugins/Import/ImportCsv.php @@ -314,7 +314,9 @@ class ImportCsv extends AbstractImportCsv // subtract data we didn't handle yet and stop processing $GLOBALS['offset'] -= strlen($buffer); break; - } elseif ($data !== true) { + } + + if ($data !== true) { // Append new data to buffer $buffer .= $data; unset($data); diff --git a/libraries/classes/Plugins/Import/ImportMediawiki.php b/libraries/classes/Plugins/Import/ImportMediawiki.php index 8a26cfcf03..2805ac7285 100644 --- a/libraries/classes/Plugins/Import/ImportMediawiki.php +++ b/libraries/classes/Plugins/Import/ImportMediawiki.php @@ -107,7 +107,9 @@ class ImportMediawiki extends ImportPlugin // Subtract data we didn't handle yet and stop processing $GLOBALS['offset'] -= mb_strlen($buffer); break; - } elseif ($data !== true) { + } + + if ($data !== true) { // Append new data to buffer $buffer = $data; unset($data); @@ -149,7 +151,9 @@ class ImportMediawiki extends ImportPlugin if (! strcmp(mb_substr($cur_buffer_line, 0, 4), '') ) { diff --git a/libraries/classes/Plugins/Import/ImportOds.php b/libraries/classes/Plugins/Import/ImportOds.php index 61f7d9655d..fa82bf75c7 100644 --- a/libraries/classes/Plugins/Import/ImportOds.php +++ b/libraries/classes/Plugins/Import/ImportOds.php @@ -121,7 +121,9 @@ class ImportOds extends ImportPlugin /* subtract data we didn't handle yet and stop processing */ $GLOBALS['offset'] -= strlen($buffer); break; - } elseif ($data !== true) { + } + + if ($data !== true) { /* Append new data to buffer */ $buffer .= $data; unset($data); @@ -247,7 +249,9 @@ class ImportOds extends ImportPlugin ) ) { return (float) $cell_attrs['value']; - } elseif ($_REQUEST['ods_recognize_currency'] + } + + if ($_REQUEST['ods_recognize_currency'] && ! strcmp('currency', (string) $cell_attrs['value-type']) ) { return (float) $cell_attrs['value']; diff --git a/libraries/classes/Plugins/Import/ImportXml.php b/libraries/classes/Plugins/Import/ImportXml.php index 5a142567cd..ad90be277e 100644 --- a/libraries/classes/Plugins/Import/ImportXml.php +++ b/libraries/classes/Plugins/Import/ImportXml.php @@ -78,7 +78,9 @@ class ImportXml extends ImportPlugin /* subtract data we didn't handle yet and stop processing */ $GLOBALS['offset'] -= strlen($buffer); break; - } elseif ($data !== true) { + } + + if ($data !== true) { /* Append new data to buffer */ $buffer .= $data; unset($data); diff --git a/libraries/classes/Server/Privileges.php b/libraries/classes/Server/Privileges.php index 5cc440ef34..7a28cec787 100644 --- a/libraries/classes/Server/Privileges.php +++ b/libraries/classes/Server/Privileges.php @@ -528,7 +528,9 @@ class Privileges return 'SELECT * FROM `mysql`.`user`' . " WHERE `User` = '" . $this->dbi->escapeString($username) . "'" . " AND `Host` = '" . $this->dbi->escapeString($hostname) . "';"; - } elseif ($table == '*') { + } + + if ($table == '*') { return 'SELECT * FROM `mysql`.`db`' . " WHERE `User` = '" . $this->dbi->escapeString($username) . "'" . " AND `Host` = '" . $this->dbi->escapeString($hostname) . "'" diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index fea9c9d76c..999042967f 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -1553,13 +1553,10 @@ class Table // only allow the above regex in unquoted identifiers // see : https://dev.mysql.com/doc/refman/5.7/en/identifiers.html return true; - } elseif ($is_backquoted) { - // If backquoted, all characters should be allowed (except w/ trailing spaces) - return true; } - // If not backquoted and doesn't follow the above regex - return false; + // If backquoted, all characters should be allowed (except w/ trailing spaces). + return $is_backquoted; } /** diff --git a/libraries/classes/Table/Search.php b/libraries/classes/Table/Search.php index 72f16d3bea..88d45f1539 100644 --- a/libraries/classes/Table/Search.php +++ b/libraries/classes/Table/Search.php @@ -271,7 +271,9 @@ final class Search // If the function takes multiple parameters if (strpos($func_type, 'IS NULL') !== false || strpos($func_type, 'IS NOT NULL') !== false) { return Util::backquote($names) . ' ' . $func_type; - } elseif ($geom_funcs[$geom_func]['params'] > 1) { + } + + if ($geom_funcs[$geom_func]['params'] > 1) { // create gis data from the criteria input $gis_data = Util::createGISData($criteriaValues, $this->dbi->getVersion()); diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index 760f49725c..b8c37c7a39 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -1602,7 +1602,9 @@ class Util $engine = strtoupper((string) $engine); if (($engine === 'INNODB') || ($engine === 'PBXT')) { return true; - } elseif ($engine === 'NDBCLUSTER' || $engine === 'NDB') { + } + + if ($engine === 'NDBCLUSTER' || $engine === 'NDB') { $ndbver = strtolower( $GLOBALS['dbi']->fetchValue('SELECT @@ndb_version_string') ); @@ -1623,7 +1625,9 @@ class Util { if ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'enable') { return true; - } elseif ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'disable') { + } + + if ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'disable') { return false; } @@ -2002,7 +2006,9 @@ class Util . 'POLYGON|MULTIPOLYGON|GEOMETRYCOLLECTION)'; if (preg_match("/^'" . $geom_types . "\(.*\)',[0-9]*$/i", $gis_string)) { return $geomFromText . '(' . $gis_string . ')'; - } elseif (preg_match('/^' . $geom_types . '\(.*\)$/i', $gis_string)) { + } + + if (preg_match('/^' . $geom_types . '\(.*\)$/i', $gis_string)) { return $geomFromText . "('" . $gis_string . "')"; } @@ -2482,7 +2488,9 @@ class Util if ($level == null) { return $tabList; - } elseif (array_key_exists($level, $tabList)) { + } + + if (array_key_exists($level, $tabList)) { return $tabList[$level]; } @@ -2555,7 +2563,9 @@ class Util $names = $GLOBALS['dbi']->getLowerCaseNames(); if ($names === '0') { return 'COLLATE utf8_bin'; - } elseif ($names === '2') { + } + + if ($names === '2') { return 'COLLATE utf8_general_ci'; } diff --git a/libraries/classes/Utils/HttpRequest.php b/libraries/classes/Utils/HttpRequest.php index 07ab665362..143b52f856 100644 --- a/libraries/classes/Utils/HttpRequest.php +++ b/libraries/classes/Utils/HttpRequest.php @@ -201,7 +201,9 @@ class HttpRequest if (curl_getinfo($curlHandle, CURLINFO_SSL_VERIFYRESULT) != 0) { if ($ssl == 0) { return $this->curl($url, $method, $returnOnlyStatus, $content, $header, CURLOPT_CAINFO); - } elseif ($ssl == CURLOPT_CAINFO) { + } + + if ($ssl == CURLOPT_CAINFO) { return $this->curl($url, $method, $returnOnlyStatus, $content, $header, CURLOPT_CAPATH); } } @@ -282,7 +284,9 @@ class HttpRequest ) { if (function_exists('curl_init')) { return $this->curl($url, $method, $returnOnlyStatus, $content, $header); - } elseif (ini_get('allow_url_fopen')) { + } + + if (ini_get('allow_url_fopen')) { return $this->fopen($url, $method, $returnOnlyStatus, $content, $header); } diff --git a/setup/config.php b/setup/config.php index 550ad641ed..64efe08738 100644 --- a/setup/config.php +++ b/setup/config.php @@ -38,7 +38,9 @@ if (Core::ifSetOr($_POST['submit_clear'], '')) { // drop post data $response->generateHeader303('index.php' . Url::getCommonRaw()); exit; -} elseif (Core::ifSetOr($_POST['submit_download'], '')) { +} + +if (Core::ifSetOr($_POST['submit_download'], '')) { // Output generated config file Core::downloadHeader('config.inc.php', 'text/plain'); $response->disable(); diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index f2b577c089..779cd1e8fc 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -217,7 +217,9 @@ abstract class TestBase extends TestCase return 'https://' . $this->getBrowserStackCredentials() . '@hub-cloud.browserstack.com/wd/hub'; - } elseif ($this->hasSeleniumConfig()) { + } + + if ($this->hasSeleniumConfig()) { return 'http://' . getenv('TESTSUITE_SELENIUM_HOST') . ':' . getenv('TESTSUITE_SELENIUM_PORT') . '/wd/hub';