fix: RemoteFileFetcher::fetch() prüft die URL selbst; Doppelprüfung im Schriften-Upload entfällt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
bfede30d33
commit
942e4220ed
@@ -84,6 +84,15 @@ final class RemoteFileFetcherTest extends TestCase
|
||||
self::assertSame('wOF2DATA', file_get_contents($this->tmp));
|
||||
}
|
||||
|
||||
public function testARefusedUrlIsNullAndNeverRequested(): void
|
||||
{
|
||||
Functions\expect('wp_safe_remote_get')->never();
|
||||
|
||||
self::assertNull($this->fetcher(['10.0.0.5'])->fetch('https://intern.example.com/x.woff2', $this->tmp, 2048, 'x'));
|
||||
self::assertNull($this->fetcher()->fetch('file:///etc/passwd', $this->tmp, 2048, 'x'));
|
||||
self::assertStringContainsString('URL refused', (string) file_get_contents($this->errorLog));
|
||||
}
|
||||
|
||||
public function testAFailedRequestIsNullAndOnlyTheLogNamesTheReasonAndTheContext(): void
|
||||
{
|
||||
Functions\when('wp_safe_remote_get')->justReturn(new WP_Error('http_request_failed', 'Connection refused'));
|
||||
|
||||
Reference in New Issue
Block a user