Repository navigation
Media: Only trust core's flag for cross-origin isolation - #15855
adamsilverstein wants to merge 4 commits into
Conversation
wp_is_cross_origin_isolated_request() also returned true when any Document-Isolation-Policy header was queued, so a plugin screen that isolates itself for its own reasons, such as the Elementor editor, got the client-side pipeline in every media frame without asking for it. Uploads there then skipped the plugin's own plupload handling. Only the flag wp_send_document_isolation_policy_header() sets now counts. A plugin that wants the pipeline on a screen core does not isolate calls that function instead of sending the header itself. The Gutenberg plugin sends the header directly on the editor screens today, so its media modal falls back to classic uploads until it defers to core's function. See #66490. Claude-Session: https://claude.ai/code/session_018vwYjVChF8EN33VU3DGbni
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
The docblocks and test comments around the upload pipeline still named wp_set_up_cross_origin_isolation() or any isolated screen as what enables it, which stopped being true once only the flag set by wp_send_document_isolation_policy_header() counted. They also left out that the function has to run before wp_enqueue_media(), so a late call isolates the page without loading the pipeline. The comments now name the function that sets the flag and state the ordering requirement. No behavior changes. See #66490. Claude-Session: https://claude.ai/code/session_018vwYjV5F1fB1H7E4PDwsnV
…function. The enqueue tests set $_wp_cross_origin_isolated by hand, so nothing would fail if wp_send_document_isolation_policy_header() stopped setting it and the pipeline silently never loaded in production. The new tests assert wp_is_cross_origin_isolated_request() flips to true only after the header is sent, and stays false when the browser does not support the policy. See #66490. Claude-Session: https://claude.ai/code/session_018vwYjV5F1fB1H7E4PDwsnV
|
I had Claude run thru the manual testing steps from the description, with and without the Gutenberg plugin. I also did some manual smoke testing. Everything behaved as expected. Here's the report:
Looks good to me. |
Trac ticket: https://core.trac.wordpress.org/ticket/66490
Item 1 on the ticket: plugin screens that send their own Document-Isolation-Policy header, like the Elementor editor, were picking up the client-side upload pipeline in every media frame without asking for it.
Claude dug into how the isolation check works and wrote this up:
AI Use
Code and description both came out of a session with 🤖 Claude Code. I will review and test.
🤖 Generated with Claude Code
https://claude.ai/code/session_018vwYjVChF8EN33VU3DGbni
Commit message