Merge pull request #18421 from kamil-tekiela/versionToInt
versionToInt never returns false
This commit is contained in:
commit
0bf861dac7
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user