[wp-trac] [WordPress Trac] #64372: Additional URL args supplied via enqueued script/style handle cause malformed ver query param when null

WordPress Trac noreply at wordpress.org
Wed Mar 11 01:30:41 UTC 2026


#64372: Additional URL args supplied via enqueued script/style handle cause
malformed ver query param when null
--------------------------------------+--------------------------
 Reporter:  westonruter               |       Owner:  westonruter
     Type:  defect (bug)              |      Status:  closed
 Priority:  low                       |   Milestone:  7.0
Component:  Script Loader             |     Version:  2.6
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+--------------------------
Changes (by westonruter):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"61927" 61927]:
 {{{
 #!CommitTicketReference repository="" revision="61927"
 Script Loader: Preserve duplicate URL query params in enqueued scripts and
 styles.

 Previously in r61397, `add_query_arg()` was used to append versions or
 handle-specific query arguments. This resulted in stripping any existing
 duplicate query variables in the source URL (common in Google Fonts URLs).
 This change refactors `WP_Styles::_css_href()` and `WP_Scripts::do_item()`
 to manually append these parameters to the URL string. This ensures all
 original query variables are preserved exactly as provided. It also
 improves fragment handling by ensuring query parameters are inserted
 before any '#' anchor while maintaining the anchor's presence.

 The URL encoding changes in `tests/phpunit/tests/dependencies/scripts.php`
 are reversions of what had previously been done in r61397.

 Developed in https://github.com/WordPress/wordpress-develop/pull/11164

 Follow-up to r61397, r61358.

 Props westonruter, jonsurrell.
 Fixes #64372.
 }}}

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


More information about the wp-trac mailing list