Make WordPress Core


Ignore:
Timestamp:
03/05/2025 10:15:09 PM (12 months ago)
Author:
flixos90
Message:

Editor: Fix block type and block metadata collection registration issues on Windows due to lack of path normalization.

Props flixos90, gziolo, joemcgill.
Fixes #63027.

File:
1 edited

Legend:

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

    r59874 r59938  
    446446     */
    447447
     448    $file_or_folder = wp_normalize_path( $file_or_folder );
     449
    448450    $metadata_file = ( ! str_ends_with( $file_or_folder, 'block.json' ) ) ?
    449451        trailingslashit( $file_or_folder ) . 'block.json' :
    450452        $file_or_folder;
    451453
    452     $is_core_block        = str_starts_with( $file_or_folder, ABSPATH . WPINC );
     454    $is_core_block        = str_starts_with( $file_or_folder, wp_normalize_path( ABSPATH . WPINC ) );
    453455    $metadata_file_exists = $is_core_block || file_exists( $metadata_file );
    454456    $registry_metadata    = WP_Block_Metadata_Registry::get_metadata( $file_or_folder );
Note: See TracChangeset for help on using the changeset viewer.