launcher.php: fix PHP 8 fatal in saveManifest

`usort($manifest['versions'] ?? [], ...)` worked in PHP 7 but is a
fatal error in PHP 8 — usort requires its first arg by reference and
the null-coalesce operator produces an rvalue, not a variable. The
existing versions.php didn't trigger it because it sorts
$manifest['versions'] directly. Fixed launcher.php to guard with an
isset/is_array check and only sort when there's actually a versions
array.

Triggered by clicking "Définir" in the new Launcher page → 500 page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-02 11:21:29 +02:00
parent c24e67f560
commit 03483d02e1
3 changed files with 7 additions and 4 deletions

View File

@@ -12,9 +12,9 @@
<ApplicationIcon></ApplicationIcon>
<AssemblyName>PSLauncher</AssemblyName>
<RootNamespace>PSLauncher.App</RootNamespace>
<Version>0.6.0</Version>
<AssemblyVersion>0.6.0.0</AssemblyVersion>
<FileVersion>0.6.0.0</FileVersion>
<Version>0.7.0</Version>
<AssemblyVersion>0.7.0.0</AssemblyVersion>
<FileVersion>0.7.0.0</FileVersion>
<!-- Single-file self-contained publish profile (used by `dotnet publish`) -->
<PublishSingleFile>true</PublishSingleFile>