Fix reading input favoriteTables

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2025-01-14 17:30:12 +00:00
parent 638df5aff5
commit 26c2985f39
3 changed files with 1 additions and 13 deletions

View File

@ -2388,12 +2388,6 @@ parameters:
count: 1
path: src/Controllers/Database/Structure/FavoriteTableController.php
-
message: '#^Parameter \#1 \$json of function json_decode expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Database/Structure/FavoriteTableController.php
-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string

View File

@ -1206,9 +1206,6 @@
<DeprecatedMethod>
<code><![CDATA[Config::getInstance()]]></code>
</DeprecatedMethod>
<MixedArgument>
<code><![CDATA[$favoriteTables]]></code>
</MixedArgument>
<MixedArrayAccess>
<code><![CDATA[$value['db']]]></code>
<code><![CDATA[$value['table']]]></code>
@ -1218,7 +1215,6 @@
<code><![CDATA[$_SESSION['tmpval']['favorites_synced'][Current::$server]]]></code>
</MixedArrayAssignment>
<MixedAssignment>
<code><![CDATA[$favoriteTables]]></code>
<code><![CDATA[$favoriteTables]]></code>
<code><![CDATA[$value]]></code>
</MixedAssignment>

View File

@ -52,9 +52,7 @@ final class FavoriteTableController implements InvocableController
$favoriteInstance = RecentFavoriteTables::getInstance(TableType::Favorite);
$favoriteTables = $request->getParam('favoriteTables');
$favoriteTables = $favoriteTables !== null ? json_decode($favoriteTables, true) : [];
$favoriteTables = json_decode($request->getParsedBodyParamAsString('favoriteTables'), true);
if (! is_array($favoriteTables)) {
$favoriteTables = [];
}