Make WordPress Core


Ignore:
Timestamp:
02/11/2022 12:12:56 PM (22 months 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/tests/phpunit/tests/blocks/register.php

    r52388 r52699  
    123123     */
    124124    public function test_removes_block_asset_path_prefix() {
     125        $result = remove_block_asset_path_prefix( 'file:block.js' );
     126
     127        $this->assertSame( 'block.js', $result );
     128    }
     129
     130    /**
     131     * @ticket 54797
     132     */
     133    public function test_removes_block_asset_path_prefix_and_current_directory() {
    125134        $result = remove_block_asset_path_prefix( 'file:./block.js' );
    126135
    127         $this->assertSame( './block.js', $result );
     136        $this->assertSame( 'block.js', $result );
    128137    }
    129138
Note: See TracChangeset for help on using the changeset viewer.