Make WordPress Core

Changeset 41056


Ignore:
Timestamp:
07/14/2017 05:40:51 PM (7 years ago)
Author:
westonruter
Message:

Widgets: Forcibly limit Video widget to only accept oEmbed URLs from YouTube and Vimeo (for now).

Merges [40939] onto 4.8 branch.
Amends [40640].
Props timmydcrawford.
See #34115, #39994.
Fixes #40935 for 4.8.1.

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

  • branches/4.8/src/wp-admin/js/widgets/media-widgets.js

    r41051 r41056  
    185185                        }
    186186
     187                        // If video, test for Vimeo and YouTube, otherwise, renderFail(). This should be removed once #34115 is resolved.
     188                        if ( 'video' === this.controller.options.mimeType && ! /vimeo|youtu\.?be/.test( urlParser.host ) ) {
     189                            embedLinkView.renderFail();
     190                            return;
     191                        }
     192
    187193                        embedLinkView.dfd = $.ajax({
    188194                            url: wp.media.view.settings.oEmbedProxyUrl,
Note: See TracChangeset for help on using the changeset viewer.