Make WordPress Core

Changeset 40939


Ignore:
Timestamp:
06/25/2017 07:23:52 AM (7 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/widgets/media-widgets.js

    r40836 r40939  
    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.