Widgets: Forcibly limit Video widget to only accept oEmbed URLs from YouTube and Vimeo (for now).
Amends [40640]. Props timmydcrawford. See #34115, #39994. Fixes #40935. git-svn-id: https://develop.svn.wordpress.org/trunk@40939 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ea1ee4f313
commit
01efaabfc5
@ -184,6 +184,12 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If video, test for Vimeo and YouTube, otherwise, renderFail(). This should be removed once #34115 is resolved.
|
||||
if ( 'video' === this.controller.options.mimeType && ! /vimeo|youtu\.?be/.test( urlParser.host ) ) {
|
||||
embedLinkView.renderFail();
|
||||
return;
|
||||
}
|
||||
|
||||
embedLinkView.dfd = $.ajax({
|
||||
url: wp.media.view.settings.oEmbedProxyUrl,
|
||||
data: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user