Make WordPress Core

Ticket #54558: 54558.diff

File 54558.diff, 572 bytes (added by costdev, 3 years ago)

Adds a leading slash to paths without one.

  • src/wp-includes/block-editor.php

    diff --git a/src/wp-includes/block-editor.php b/src/wp-includes/block-editor.php
    index aaa249cb7b..50a20fcac7 100644
    a b function block_editor_rest_api_preload( array $preload_paths, $block_editor_cont 
    468468         */
    469469        $backup_global_post = ! empty( $post ) ? clone $post : $post;
    470470
     471        foreach ( $preload_paths as &$path ) {
     472                if ( ! str_starts_with( $path, '/' ) ) {
     473                        $path = '/' . $path;
     474                }
     475        }
     476
    471477        $preload_data = array_reduce(
    472478                $preload_paths,
    473479                'rest_preload_api_request',