Changes between Version 1 and Version 2 of Ticket #59018, comment 20
- Timestamp:
- 08/22/2023 11:52:29 PM (16 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #59018, comment 20
v1 v2 23 23 where 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 ? ...`. 24 24 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.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 seems true for the proposed patch with adding a slash. 26 26 27 27 Seems 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.