WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/19/2017 12:06:25 AM (4 years ago)
Author:
westonruter
Message:

Widgets: Harden logic for checking for valid media URLs.

  • Update deprecated isHostedVideo method to always return true since all oEmbeds are now supported.
  • Disable scanImage for non-image media widgets.
  • Ensure embed URL field element is matched from current media frame instance due to bug where media frames are not destroyed upon closing.
  • Update error message for invalid video URLs to ask user to check the URL for validity.

Props gk.loveweb, octalmage, westonruter.
See #42039, #40935.
Fixes #41052.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-media-video.php

    r41827 r41933  
    4242            'media_library_state_single' => __( 'Video Widget' ),
    4343            /* translators: %s: a list of valid video file extensions */
    44             'unsupported_file_type' => sprintf( __( 'Sorry, we can&#8217;t display the video file type selected. Please select a supported video file (%s) or stream (e.g. YouTube and Vimeo) instead.' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ),
     44            'unsupported_file_type' => sprintf( __( 'Sorry, we can&#8217;t load the video at the supplied URL. Please check that the URL is for a supported video file (%s) or stream (e.g. YouTube and Vimeo).' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ),
    4545        ) );
    4646    }
Note: See TracChangeset for help on using the changeset viewer.