Skip to content

Commit 2e27ac1

Browse files
committed
Skip the upload-path escaping test on Windows
`testFieldEscapesPathUrl` uploads a file whose client name carries a quote, to show that an unrestricted field carries it into the attachment URL. Windows does not allow a quote in a file name, so the upload is refused there and the URL the test asserts on cannot arise at all. Skipped with that reason rather than weakened: `testFieldEscapesThumbUrl` already covers the same partials from a stored record on every platform.
1 parent c10b7e6 commit 2e27ac1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎modules/backend/tests/formwidgets/FileUploadEscapingTest.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ public function testFieldEscapesThumbUrl(): void
135135
*/
136136
public function testFieldEscapesPathUrl(): void
137137
{
138+
if (DIRECTORY_SEPARATOR === '\\') {
139+
$this->markTestSkipped(
140+
'Windows rejects a file name containing a quote, so this upload cannot be stored there and '
141+
. 'the URL it asserts on cannot arise. testFieldEscapesThumbUrl covers the same partials '
142+
. 'from a stored record on every platform.'
143+
);
144+
}
145+
138146
$single = $this->upload('avatar', self::UNSAFE_EXTENSION, ['mode' => 'file']);
139147

140148
$this->assertStringContainsString(

0 commit comments

Comments
 (0)