Make WordPress Core


Ignore:
Timestamp:
03/11/2026 11:38:35 PM (3 months ago)
Author:
adamsilverstein
Message:

Editor: Skip cross-origin isolation for third-party page builders.

Document-Isolation-Policy (DIP) isolates the document and blocks same-origin iframe access that page builders rely on. Skip DIP setup when a third-party page builder overrides the block editor via a custom action query parameter.

Also gates wp_is_client_side_media_processing_enabled() on a secure context check, since SharedArrayBuffer requires a secure context (HTTPS or localhost).

Props adamsilverstein, westonruter, mukesh27, louiswol94, manhar, illuminea.
Fixes #64803.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r61934 r61947  
    64126412 */
    64136413function wp_is_client_side_media_processing_enabled(): bool {
     6414    // This is due to SharedArrayBuffer requiring a secure context.
     6415    $host    = strtolower( (string) strtok( $_SERVER['HTTP_HOST'] ?? '', ':' ) );
     6416    $enabled = ( is_ssl() || 'localhost' === $host || str_ends_with( $host, '.localhost' ) );
     6417
    64146418    /**
    64156419     * Filters whether client-side media processing is enabled.
     
    64176421     * @since 7.0.0
    64186422     *
    6419      * @param bool $enabled Whether client-side media processing is enabled. Default true.
    6420      */
    6421     return (bool) apply_filters( 'wp_client_side_media_processing_enabled', true );
     6423     * @param bool $enabled Whether client-side media processing is enabled. Default true if the page is served in a secure context.
     6424     */
     6425    return (bool) apply_filters( 'wp_client_side_media_processing_enabled', $enabled );
    64226426}
    64236427
     
    64326436    }
    64336437
    6434     wp_add_inline_script( 'wp-block-editor', 'window.__clientSideMediaProcessing = true', 'before' );
     6438    wp_add_inline_script( 'wp-block-editor', 'window.__clientSideMediaProcessing = true;', 'before' );
    64356439
    64366440    $chromium_version = wp_get_chromium_major_version();
     
    64786482 * on supported browsers (Chromium 137+).
    64796483 *
     6484 * Skips setup when a third-party page builder overrides the block
     6485 * editor via a custom `action` query parameter, as DIP would block
     6486 * same-origin iframe access that these editors rely on.
     6487 *
    64806488 * @since 7.0.0
    64816489 */
     
    64926500
    64936501    if ( ! $screen->is_block_editor() && 'site-editor' !== $screen->id && ! ( 'widgets' === $screen->id && wp_use_widgets_block_editor() ) ) {
     6502        return;
     6503    }
     6504
     6505    /*
     6506     * Skip when a third-party page builder overrides the block editor.
     6507     * DIP isolates the document into its own agent cluster,
     6508     * which blocks same-origin iframe access that these editors rely on.
     6509     */
     6510    if ( isset( $_GET['action'] ) && 'edit' !== $_GET['action'] ) {
    64946511        return;
    64956512    }
Note: See TracChangeset for help on using the changeset viewer.