Changes between Initial Version and Version 5 of Ticket #42730
- Timestamp:
- 11/29/2017 12:07:26 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #42730
- Property Component General → Script Loader
- Property Type enhancement → defect (bug)
- Property Version trunk
- Property Resolution → invalid
- Property Status new → closed
- Property Milestone Awaiting Review
-
Ticket #42730 – Description
initial v5 3 3 This causes issues if the URL contains parameters, for example `https://api.ipify.org?format=jsonp&callback=getip`. This gets turned into `https://api.ipify.org?format=jsonp#038;callback=getip` and results in failure of the script. 4 4 5 I think I've tracked this down to the `do_item()` function of the wp-includes/class.wp-scripts.php file. In here the `script_loader_src ` 6 is called on 2 occasions, once the returned value is left unescaped and once it is passed through `esc_url()`. It is the latter application of the filter that escapes the ampersand and breaks the URL to the javascript file. 5 I think I've tracked this down to the `do_item()` function of the wp-includes/class.wp-scripts.php file. In here the `script_loader_src` is called on 2 occasions, once the returned value is left unescaped and once it is passed through `esc_url()`. It is the latter application of the filter that escapes the ampersand and breaks the URL to the javascript file. 7 6 8 7 Should the call to the `esc_url()` be removed to allow parameters in the URLs or is there another way to '''enqueue''' such scripts that I have not yet found (currently I'm just hooking to wp_head and echoing the script).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)