Make WordPress Core


Ignore:
Timestamp:
02/11/2022 12:12:56 PM (3 years ago)
Author:
gziolo
Message:

I18n: Standardize the script paths for blocks

When providing file paths to scripts (editorScript, script or viewScript), when there is a trailing ./ included then there was a different md5 generated for the file that didn't match the one used with the file generated in the translations folder.

Props Rahe.
See #54797.

File:
1 edited

Legend:

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

    r52597 r52699  
    2121        return $asset_handle_or_path;
    2222    }
    23     return substr(
     23    $path = substr(
    2424        $asset_handle_or_path,
    2525        strlen( $path_prefix )
    2626    );
     27    if ( strpos( $path, './' ) === 0 ) {
     28        $path = substr( $path, 2 );
     29    }
     30    return $path;
    2731}
    2832
Note: See TracChangeset for help on using the changeset viewer.