Changeset 52699
- Timestamp:
- 02/11/2022 12:12:56 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r52597 r52699 21 21 return $asset_handle_or_path; 22 22 } 23 returnsubstr(23 $path = substr( 24 24 $asset_handle_or_path, 25 25 strlen( $path_prefix ) 26 26 ); 27 if ( strpos( $path, './' ) === 0 ) { 28 $path = substr( $path, 2 ); 29 } 30 return $path; 27 31 } 28 32 -
trunk/tests/phpunit/tests/blocks/register.php
r52388 r52699 123 123 */ 124 124 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() { 125 134 $result = remove_block_asset_path_prefix( 'file:./block.js' ); 126 135 127 $this->assertSame( ' ./block.js', $result );136 $this->assertSame( 'block.js', $result ); 128 137 } 129 138
Note: See TracChangeset
for help on using the changeset viewer.