diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0069e694a4..212724343a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -121,13 +121,8 @@ parameters: path: src/Advisory/Advisor.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 1 - path: src/Bookmarks/Bookmark.php - - - - message: "#^Parameter \\#1 \\$str of method PhpMyAdmin\\\\DatabaseInterface\\:\\:escapeString\\(\\) expects string, mixed given\\.$#" - count: 1 + message: "#^Parameter \\#2 \\$replace of function str_replace expects array\\|string, mixed given\\.$#" + count: 2 path: src/Bookmarks/Bookmark.php - diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 4cb89dd4af..120c7ae38d 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -40,12 +40,13 @@ - - escapeString - - $variables[$i] + $var + $var + + $var + getDatabase diff --git a/src/Bookmarks/Bookmark.php b/src/Bookmarks/Bookmark.php index bc45fd1501..3e0c5fda69 100644 --- a/src/Bookmarks/Bookmark.php +++ b/src/Bookmarks/Bookmark.php @@ -137,10 +137,7 @@ class Bookmark // replace variable placeholders with values $numberOfVariables = $this->getVariableCount(); for ($i = 1; $i <= $numberOfVariables; $i++) { - $var = ''; - if (! empty($variables[$i])) { - $var = $this->dbi->escapeString($variables[$i]); - } + $var = $variables[$i] ?? ''; $query = str_replace('[VARIABLE' . $i . ']', $var, $query); // backward compatibility