Skip to content

Commit

Permalink
replace isset to empty
Browse files Browse the repository at this point in the history
IF statement ! isset($this->uiprefs) was causing issue.

Private property 'uiprefs' is initialized to empty array, so ! isset($this->uiprefs) is always FALSE;
It's not hopefull, so I replace ! isset($this->uiprefs) to empty($this->uiprefs) to fix #17617 bug;

Fixes #17617
Closes #17644

Signed-off-by: Atomu Oku <atomu.work@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
atomu330 authored and MauricioFauth committed Jul 19, 2022
1 parent ddb4d5b commit 6957064
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -19,6 +19,7 @@ phpMyAdmin - ChangeLog
- issue #17584 It's now possible to browse a database that includes two % in its name
- issue Fix PHP 8.2 deprecated string interpolation syntax
- issue Some languages are now correctly detected from the HTTP header
- issue #17617 Sorting is correctly remembered when $cfg['RememberSorting'] is true

5.2.0 (2022-05-10)
- issue #16521 Upgrade Bootstrap to version 5
Expand Down
6 changes: 3 additions & 3 deletions libraries/classes/Table.php
Expand Up @@ -1867,7 +1867,7 @@ protected function loadUiPrefs(): void
*/
public function getUiProp($property)
{
if (! isset($this->uiprefs)) {
if (empty($this->uiprefs)) {
$this->loadUiPrefs();
}

Expand Down Expand Up @@ -1937,7 +1937,7 @@ public function getUiProp($property)
*/
public function setUiProp($property, $value, $tableCreateTime = null)
{
if (! isset($this->uiprefs)) {
if (empty($this->uiprefs)) {
$this->loadUiPrefs();
}

Expand Down Expand Up @@ -1984,7 +1984,7 @@ public function setUiProp($property, $value, $tableCreateTime = null)
*/
public function removeUiProp($property)
{
if (! isset($this->uiprefs)) {
if (empty($this->uiprefs)) {
$this->loadUiPrefs();
}

Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Expand Up @@ -8320,11 +8320,6 @@ parameters:
count: 1
path: libraries/classes/Table.php

-
message: "#^Property PhpMyAdmin\\\\Table\\:\\:\\$uiprefs \\(array\\) in isset\\(\\) is not nullable\\.$#"
count: 3
path: libraries/classes/Table.php

-
message: "#^Property PhpMyAdmin\\\\Table\\:\\:\\$uiprefs type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Expand Up @@ -12908,11 +12908,6 @@
</PossiblyNullArgument>
</file>
<file src="libraries/classes/Table.php">
<DocblockTypeContradiction occurrences="3">
<code>isset($this-&gt;uiprefs)</code>
<code>isset($this-&gt;uiprefs)</code>
<code>isset($this-&gt;uiprefs)</code>
</DocblockTypeContradiction>
<InvalidReturnStatement occurrences="1">
<code>$tableAutoIncrement ?? ''</code>
</InvalidReturnStatement>
Expand Down

0 comments on commit 6957064

Please sign in to comment.