[wp-trac] [WordPress Trac] #54243: Inlined block styles that involve external assets (images/fonts) and relative URL's not working as expected

WordPress Trac noreply at wordpress.org
Tue May 9 12:15:59 UTC 2023


#54243: Inlined block styles that involve external assets (images/fonts) and
relative URL's not working as expected
----------------------------------------+------------------------------
 Reporter:  cdyerkes                    |       Owner:  gziolo
     Type:  defect (bug)                |      Status:  closed
 Priority:  normal                      |   Milestone:  5.9
Component:  Editor                      |     Version:  5.9
 Severity:  normal                      |  Resolution:  fixed
 Keywords:  has-patch has-testing-info  |     Focuses:  javascript, css
----------------------------------------+------------------------------

Comment (by audrasjb):

 In [changeset:"55736" 55736]:
 {{{
 #!CommitTicketReference repository="" revision="55736"
 Script Loader: Optimize performance of
 `_wp_normalize_relative_css_links()` by more than 2x.

 - Replace `preg_match_all()` and its secondary `str_replace()` call with
 `preg_replace_callback()`.
 - Fix case where paths beginning with `http` and `https` (but not `http:`
 and `https:`) were erroneously not counted as relative.
 - Improve code style and readability by consolidating conditions and
 returning once.
 - Use `str_starts_with()` consistently instead of `strpos()`.

 Follow-up to [52036], [52695], and [52754].

 Props westonruter, adamsilverstein, azaozz.
 Merges [55658] and [55669] to the 6.2 branch.
 Fixes #58069.
 See #54243.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54243#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list