Make WordPress Core


Ignore:
Timestamp:
02/21/2024 09:36:18 AM (3 months ago)
Author:
audrasjb
Message:

Editor: Allow symlinks in directories provided to get_block_asset_url().

This changeset allows using symbolic links for editorScript and editorStyle in register_block_type(). This adds realpath to template and stylesheet in get_block_asset_url() to ensure returning canonicalized absolute pathnames.

Follow-up to [56683].

Props antonlukin, spacedmonkey, maxpertici.
Fixes #59175.
See #58525.

File:
1 edited

Legend:

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

    r57668 r57675  
    107107    $template = get_template();
    108108    if ( ! isset( $template_paths_norm[ $template ] ) ) {
    109         $template_paths_norm[ $template ] = wp_normalize_path( get_template_directory() );
     109        $template_paths_norm[ $template ] = wp_normalize_path( realpath( get_template_directory() ) );
    110110    }
    111111
     
    117117        $stylesheet = get_stylesheet();
    118118        if ( ! isset( $template_paths_norm[ $stylesheet ] ) ) {
    119             $template_paths_norm[ $stylesheet ] = wp_normalize_path( get_stylesheet_directory() );
     119            $template_paths_norm[ $stylesheet ] = wp_normalize_path( realpath( get_stylesheet_directory() ) );
    120120        }
    121121
Note: See TracChangeset for help on using the changeset viewer.