Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #59018, comment 22


Ignore:
Timestamp:
08/23/2023 08:05:08 PM (8 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59018, comment 22

    initial v1  
    11Looking at this more: seems adding a trailing slash would make it work (somehow) for now. Not a fan of this solution but then there seems to be some "pretty unusual" code there (not really sure what is the intent for this use of substr_replace: `substr_replace( $script_path, '.asset.php', - strlen( '.js' ) )`, why the negative index and why do `strlen()` of a hard-coded string).
    22
    3 Thinking the `trailingslashit()` would be better applied to `$template_path_norm` and `$template_path_norm`, not just when comparing the paths. Later on when construction the script/stylesheet URL `get_theme_file_uri()` removes slashes from the beginning of the fragment anyways.
     3Thinking the `trailingslashit()` would be better applied to `$template_path_norm` and `$stylesheet_path_norm`, not just when comparing the paths. Later on when construction the script/stylesheet URL `get_theme_file_uri()` removes slashes from the beginning of the fragment anyways.