| 1 | | There's a small error in the `register_block_style_handle()` function which prevents us from properly determining if a stylesheet for a block exists or now. |
| 2 | | We use `$style_path_norm = wp_normalize_path( realpath( dirname( $metadata['file'] ) . '/' . $style_path ) );` to get the stylesheet's path, and then we check if the file exists by doing `$has_style_file = false !== $style_path_norm;`. |
| 3 | | |
| 4 | | The problem is that `realpath()` returns`false` if the file does not exist, however it then passes through `wp_normalize_path()` and the `false` value gets converted to an empty string - therefore making the `false !== $style_path_norm` condition to fail. |
| | 1 | Adds PHPUnit test for https://core.trac.wordpress.org/changeset/54155 |