[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
Wed Apr 19 01:24:57 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 westonruter):

 In [changeset:"55658" 55658]:
 {{{
 #!CommitTicketReference repository="" revision="55658"
 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].

 Fixes #58069.
 See #54243.
 }}}

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


More information about the wp-trac mailing list