Skip to content

Commit

Permalink
Merge branch 'QA_5_1' into QA_5_2
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed May 6, 2022
2 parents 2dc8d21 + 7411e59 commit 9730237
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ phpMyAdmin - ChangeLog
- issue #17335 Fix column visibility dropdown when the column name is too long
- issue #17445 Fix issue when exporting using Firefox or Safari on PHP 8.1.4
- issue Update JavaScript dependencies
- issue #17428 Fix case where errors were thrown when browsing a table

5.1.3 (2022-02-10)
- issue #17308 Fix broken pagination links in the navigation sidebar
Expand Down
15 changes: 12 additions & 3 deletions libraries/classes/Display/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -2869,20 +2869,29 @@ private function getColumnParams(array $analyzedSqlResults): array
if ($this->isSelect($analyzedSqlResults)) {
$pmatable = new Table($this->properties['table'], $this->properties['db']);
$colOrder = $pmatable->getUiProp(Table::PROP_COLUMN_ORDER);
$fieldsCount = $this->properties['fields_cnt'];
/* Validate the value */
if ($colOrder !== false) {
$fieldsCount = $this->properties['fields_cnt'];
if (is_array($colOrder)) {
foreach ($colOrder as $value) {
if ($value < $fieldsCount) {
continue;
}

$pmatable->removeUiProp(Table::PROP_COLUMN_ORDER);
$fieldsCount = false;
break;
}

if ($fieldsCount !== count($colOrder)) {
$pmatable->removeUiProp(Table::PROP_COLUMN_ORDER);
$colOrder = false;
}
}

$colVisib = $pmatable->getUiProp(Table::PROP_COLUMN_VISIB);
if (is_array($colVisib) && $fieldsCount !== count($colVisib)) {
$pmatable->removeUiProp(Table::PROP_COLUMN_VISIB);
$colVisib = false;
}
} else {
$colOrder = false;
$colVisib = false;
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2885,11 +2885,6 @@ parameters:
count: 2
path: libraries/classes/Dbal/MysqliResult.php

-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: libraries/classes/Display/Results.php

-
message: "#^Binary operation \"\\+\" between array\\<string, bool\\|string\\>\\|string and array\\{default_action\\: 'insert'\\} results in an error\\.$#"
count: 3
Expand Down
6 changes: 4 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<files psalm-version="4.23.0@f1fe6ff483bf325c803df9f510d09a03fd796f88">
<file src="index.php">
<InvalidGlobal occurrences="1">
<code>global $route, $containerBuilder, $request;</code>
Expand Down Expand Up @@ -5443,8 +5443,10 @@
<code>$user</code>
<code>$warningsCount</code>
</MixedArgument>
<MixedArgumentTypeCoercion occurrences="4">
<MixedArgumentTypeCoercion occurrences="6">
<code>$one_database_name</code>
<code>$one_database_tables</code>
<code>$one_database_tables</code>
<code>$table_name</code>
<code>uksort($each_tables, 'strnatcasecmp')</code>
<code>usort($tables, 'strnatcasecmp')</code>
Expand Down

0 comments on commit 9730237

Please sign in to comment.