feat: media upload by URL and base64 with whitelist and size limit
MediaImporter streams URL imports via wp_safe_remote_get with limit_response_size, checks Content-Length, intersects the MIME whitelist with get_allowed_mime_types and validates real content; base64 is size-checked before decoding. Server-side failures are write_failed; a failed alt text deletes the new attachment again (or partial_write). MediaUploads is the shared permission/result helper of both upload abilities. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -19,6 +19,8 @@ final class MediaIntegrationTest extends TestCase
|
||||
'lit/media-search',
|
||||
'lit/media-get',
|
||||
'lit/media-preview',
|
||||
'lit/media-upload-from-url',
|
||||
'lit/media-upload',
|
||||
'lit/media-download',
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user