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
@@ -118,6 +118,9 @@ final class DiviFontsUploadAbilityTest extends TestCase
|
||||
/** The fake fetcher's download: writes the body of $url into $tmp. */
|
||||
public function fakeFetch(string $url, string $tmp, int $maxBytes, string $context): ?array
|
||||
{
|
||||
if (! $this->allowed($url)) { // like the real fetch(): a refused URL is never requested
|
||||
return null;
|
||||
}
|
||||
$this->fetches[] = ['url' => $url, 'tmp' => $tmp, 'max' => $maxBytes, 'context' => $context];
|
||||
$body = $this->bodies[$url] ?? null;
|
||||
if ($body === null) {
|
||||
@@ -258,7 +261,7 @@ final class DiviFontsUploadAbilityTest extends TestCase
|
||||
|
||||
self::assertToolError($result, 'font_fetch_failed');
|
||||
self::assertSame(['files.ttf' => 'nicht abrufbar'], self::errorFields($result));
|
||||
self::assertSame([self::WOFF2_URL], array_column($this->fetches, 'url'), 'fetch() skipped the refused URL');
|
||||
self::assertSame([self::WOFF2_URL], array_column($this->fetches, 'url'), 'the refused URL was never requested');
|
||||
$this->assertTempFilesRemoved();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user