Kaynağa Gözat

fix: repair CI on Windows and pin Psalm job to PHP 8.3

- testNormalizeZipPathSanitizes expected forward slashes, but
  normalizeZipPath() joins components with the platform directory
  separator, which broke the test on Windows. Convert the expected
  path to the platform separator instead.
- Psalm 4.30 crashes on PHP 8.4 with implicit nullable parameter
  deprecations raised from its own code, so run the static analysis
  job on PHP 8.3, the newest version Psalm 4 supports.
Ne-Lexa 3 hafta önce
ebeveyn
işleme
e2fb47c8e7

+ 3 - 1
.github/workflows/build.yml

@@ -130,7 +130,9 @@ jobs:
                 name: Install PHP with extensions
                 uses: shivammathur/setup-php@v2
                 with:
-                    php-version: '8.4'
+                    # Psalm 4 crashes on PHP 8.4+ (implicit nullable deprecations
+                    # in its own code), so the analysis job is pinned to 8.3.
+                    php-version: '8.3'
                     extensions:  ${{ env.extensions }}
                     ini-values:  ${{ env.PHP_INI }}
                     tools:       composer:v2

+ 2 - 0
tests/ZipSlipVulnerabilityTest.php

@@ -150,6 +150,8 @@ class ZipSlipVulnerabilityTest extends ZipTestCase
      */
     public function testNormalizeZipPathSanitizes(string $entryName, string $expectedPath): void
     {
+        // The normalizer joins components with the platform directory separator.
+        $expectedPath = str_replace('/', \DIRECTORY_SEPARATOR, $expectedPath);
         static::assertSame($expectedPath, FilesUtil::normalizeZipPath($entryName));
     }