Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #59018, comment 20


Ignore:
Timestamp:
08/22/2023 11:52:29 PM (8 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59018, comment 20

    v1 v2  
    2323where both match `str_starts_with( $script_path_norm, ... )` so `$is_parent_theme_block` is erroneously set to true. Later on that's used when determining the URL in `$script_uri = $is_parent_theme_block ? ...`.
    2424
    25 Assuming that `$is_parent_theme_block` and `$is_child_theme_block` cannot be true at the same time, an "easy fix" may be to test for a child theme block first and if negative, test for a parent theme. However that leaves the edge case where a parent theme's name/directory might contain the child theme's name (the reverse case). The same is true for the proposed patch with adding a slash.
     25Assuming that `$is_parent_theme_block` and `$is_child_theme_block` cannot be true at the same time, an "easy fix" may be to test for a child theme block first and if negative, test for a parent theme. However that leaves the edge case where a parent theme's name/directory might contain the child theme's name (the reverse case). The same seems true for the proposed patch with adding a slash.
    2626
    2727Seems matching with the longer string first may work, but is somewhat "weak". Ideally this comparison should not be used to determine whether a block is from a parent or child theme.