Merge pull request #18083 from kamil-tekiela/Fix-PHP-8-issues

Fix PHP 8 issues due to changed internal functions
This commit is contained in:
Maurício Meneghini Fauth 2023-02-13 19:04:31 -03:00 committed by GitHub
commit ef941c2080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 36 deletions

View File

@ -1132,7 +1132,7 @@ class InsertEdit
$specialChars = bin2hex($column['Default']);
} elseif (substr($trueType, -4) === 'text') {
$textDefault = substr($column['Default'], 1, -1);
$specialChars = stripcslashes($textDefault !== false ? $textDefault : $column['Default']);
$specialChars = stripcslashes($textDefault !== '' ? $textDefault : $column['Default']);
} else {
$specialChars = htmlspecialchars($column['Default']);
}

View File

@ -236,7 +236,6 @@ class ZipExtension
$data = $newData;
} elseif (is_array($data) && is_array($name) && count($data) === count($name)) {
/** @var array $data */
$data = array_combine($name, $data);
} else {
return false;
@ -269,7 +268,7 @@ class ZipExtension
$uncLen = strlen($dump);
$crc = crc32($dump);
$zdata = (string) gzcompress($dump);
$zdata = substr((string) substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
$zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
$cLen = strlen($zdata);
$fr = "\x50\x4b\x03\x04"
. "\x14\x00" // ver needed to extract

View File

@ -4895,11 +4895,6 @@ parameters:
count: 1
path: libraries/classes/IndexColumn.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
path: libraries/classes/InsertEdit.php
-
message: "#^Method PhpMyAdmin\\\\InsertEdit\\:\\:analyzeTableColumnsArray\\(\\) has parameter \\$column with no value type specified in iterable type array\\.$#"
count: 1
@ -5245,11 +5240,6 @@ parameters:
count: 1
path: libraries/classes/InsertEdit.php
-
message: "#^Strict comparison using \\!\\=\\= between string and false will always evaluate to true\\.$#"
count: 1
path: libraries/classes/InsertEdit.php
-
message: "#^Method PhpMyAdmin\\\\InternalRelations\\:\\:getInformationSchema\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
@ -9165,11 +9155,6 @@ parameters:
count: 1
path: libraries/classes/VersionInformation.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 1
path: libraries/classes/ZipExtension.php
-
message: "#^Method PhpMyAdmin\\\\ZipExtension\\:\\:createFile\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
count: 1
@ -9190,11 +9175,6 @@ parameters:
count: 1
path: libraries/classes/ZipExtension.php
-
message: "#^PHPDoc tag @var for variable \\$data has no value type specified in iterable type array\\.$#"
count: 1
path: libraries/classes/ZipExtension.php
-
message: "#^Call to function method_exists\\(\\) with 'PHPUnit\\\\\\\\Framework\\\\\\\\TestCase' and 'assertFileDoesNotEx…' will always evaluate to true\\.$#"
count: 1

View File

@ -9271,9 +9271,6 @@
</PossiblyUnusedMethod>
</file>
<file src="libraries/classes/InsertEdit.php">
<DocblockTypeContradiction>
<code>$column['Default']</code>
</DocblockTypeContradiction>
<InvalidArgument>
<code>$urlParams</code>
</InvalidArgument>
@ -9364,7 +9361,7 @@
<code>$specialChars</code>
<code>$specialChars</code>
<code>$specialCharsEncoded</code>
<code>$textDefault !== false ? $textDefault : $column['Default']</code>
<code>$textDefault !== '' ? $textDefault : $column['Default']</code>
<code>$transformationPlugin-&gt;getScripts()</code>
<code>$transformation[$type . '_options'] ?? ''</code>
<code>$trueType</code>
@ -9515,9 +9512,6 @@
<RedundantCast>
<code>(int) $GLOBALS['cfg']['InsertRows']</code>
</RedundantCast>
<RedundantConditionGivenDocblockType>
<code>$textDefault !== false</code>
</RedundantConditionGivenDocblockType>
</file>
<file src="libraries/classes/IpAllowDeny.php">
<InvalidArrayOffset>
@ -16301,12 +16295,6 @@
<PossiblyUnusedParam>
<code>$time</code>
</PossiblyUnusedParam>
<RedundantCastGivenDocblockType>
<code>(string) substr($zdata, 0, strlen($zdata) - 4)</code>
</RedundantCastGivenDocblockType>
<UnnecessaryVarAnnotation>
<code>array</code>
</UnnecessaryVarAnnotation>
</file>
<file src="libraries/config.default.php">
<UnusedVariable>