[wp-trac] [WordPress Trac] #41048: `WP_oEmbed_Controller::get_proxy_item()` should remove `_wpnonce` from cached `$args`
WordPress Trac
noreply at wordpress.org
Wed Jun 14 19:09:14 UTC 2017
#41048: `WP_oEmbed_Controller::get_proxy_item()` should remove `_wpnonce` from
cached `$args`
--------------------------+-----------------------------
Reporter: r-a-y | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.8
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When caching oEmbed proxy requests:
https://github.com/WordPress/WordPress/blob/4.8-branch/wp-includes/class-
wp-oembed-controller.php#L159
The following arguments are used to generate the cache key:
{{{
Array
(
[format] => json
[maxwidth] => 600
[discover] =>
[url] => URL
[_wpnonce] => 94f457a20b
)
}}}
`_wpnonce` is added because of `wp.media.view.settings.nonce.wpRestApi`.
Since `_wpnonce` is variable, I think it would make sense to remove the
`_wpnonce` key from the `$args` array so the cache is more likely to be
hit.
It also makes it easier for plugins to reference the oEmbed transient when
overriding `wp_media_shortcode()` for use with the Video Widget.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41048>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list