Changes between Initial Version and Version 5 of Ticket #42730
- Timestamp:
- 11/29/2017 12:07:26 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #42730
-
Property
Status
changed from
new
toclosed
-
Property
Resolution
changed from
to
invalid
-
Property
Component
changed from
General
toScript Loader
-
Property
Version
changed from
trunk
to -
Property
Milestone
changed from
Awaiting Review
to -
Property
Type
changed from
enhancement
todefect (bug)
-
Property
Status
changed from
-
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).