Merge pull request #18421 from kamil-tekiela/versionToInt

versionToInt never returns false
This commit is contained in:
Maurício Meneghini Fauth 2023-05-18 18:25:23 -03:00 committed by GitHub
commit 0bf861dac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 28 deletions

View File

@ -140,28 +140,8 @@ class Index
$date = $latestCompatible['date'];
$versionUpstream = $versionInformation->versionToInt($version);
if ($versionUpstream === false) {
self::messagesSet(
'error',
$messageId,
__('Version check'),
__('Got invalid version string from server'),
);
return;
}
$versionLocal = $versionInformation->versionToInt(Version::VERSION);
if ($versionLocal === false) {
self::messagesSet(
'error',
$messageId,
__('Version check'),
__('Unparsable version string'),
);
return;
}
if ($versionUpstream > $versionLocal) {
$version = htmlspecialchars($version);

View File

@ -77,10 +77,8 @@ class VersionInformation
* Calculates numerical equivalent of phpMyAdmin version string
*
* @param string $version version
*
* @return mixed false on failure, integer on success
*/
public function versionToInt(string $version): mixed
public function versionToInt(string $version): int
{
$parts = explode('-', $version);
if (count($parts) > 1) {

View File

@ -12573,12 +12573,7 @@
<code>$removeIds[]</code>
<code>$type</code>
<code>$version</code>
<code>$versionLocal</code>
<code>$versionUpstream</code>
</MixedAssignment>
<MixedOperand>
<code>$versionLocal</code>
</MixedOperand>
</file>
<file src="libraries/classes/Sql.php">
<DeprecatedMethod>