fix
CI/CD / preconditions (pull_request) Successful in 2s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 59s
CI/CD / Publish immutable image (pull_request) Canceled after 0s
CI/CD / test_and_check_app (pull_request) Canceled after 4m37s
macOS checks / Native Rust tests and unsigned build (pull_request) Canceled after 0s
CI/CD / preconditions (pull_request) Successful in 2s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 59s
CI/CD / Publish immutable image (pull_request) Canceled after 0s
CI/CD / test_and_check_app (pull_request) Canceled after 4m37s
macOS checks / Native Rust tests and unsigned build (pull_request) Canceled after 0s
This commit is contained in:
@@ -9,7 +9,6 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- fix/dependency-cves
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Unit;
|
|
||||||
|
|
||||||
use League\Flysystem\CorruptedPathDetected;
|
|
||||||
use League\Flysystem\WhitespacePathNormalizer;
|
|
||||||
use PHPUnit\Framework\Attributes\DataProvider;
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
class FilesystemPathSecurityTest extends TestCase
|
|
||||||
{
|
|
||||||
#[DataProvider('corruptedPaths')]
|
|
||||||
public function test_corrupted_paths_are_rejected(string $path): void
|
|
||||||
{
|
|
||||||
$this->expectException(CorruptedPathDetected::class);
|
|
||||||
|
|
||||||
(new WhitespacePathNormalizer)->normalizePath($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, array{string}>
|
|
||||||
*/
|
|
||||||
public static function corruptedPaths(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'control character' => ["avatars/user\x00.svg"],
|
|
||||||
'malformed UTF-8' => ["avatars/user\xFF.svg"],
|
|
||||||
'control character hidden by malformed UTF-8' => ["avatars/user\xFF\x00.svg"],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function test_valid_unicode_paths_remain_supported(): void
|
|
||||||
{
|
|
||||||
$this->assertSame(
|
|
||||||
'avatars/benützer.svg',
|
|
||||||
(new WhitespacePathNormalizer)->normalizePath('./avatars//benützer.svg'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user