Make WordPress Core

Changeset 37744


Ignore:
Timestamp:
06/18/2016 09:46:17 AM (8 years ago)
Author:
swissspidy
Message:

Embeds: Remove support for Google Video.

While the service has been retired for years, it now has completely stopped working. Thus there is no reason to keep it.

Props Viper007Bond.
Fixes #36304.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r37702 r37744  
    37413741    return $text;
    37423742}
     3743
     3744/**
     3745 * The Google Video embed handler callback.
     3746 *
     3747 * Deprecated function that previously assisted in turning Google Video URLs
     3748 * into embeds but that service has since been shut down.
     3749 *
     3750 * @since 2.9.0
     3751 * @deprecated 4.6.0
     3752 *
     3753 * @return string An empty string.
     3754 */
     3755function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
     3756    _deprecated_function( __FUNCTION__, '4.6.0' );
     3757
     3758    return '';
     3759}
  • trunk/src/wp-includes/embed.php

    r37729 r37744  
    176176    wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/(?:v|embed)/([^/]+)#i', 'wp_embed_handler_youtube' );
    177177
    178     wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
    179 
    180178    /**
    181179     * Filters the audio embed handler callback.
     
    195193     */
    196194    wp_embed_register_handler( 'video', '#^https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
    197 }
    198 
    199 /**
    200  * The Google Video embed handler callback.
    201  *
    202  * Google Video does not support oEmbed.
    203  *
    204  * @see WP_Embed::register_handler()
    205  * @see WP_Embed::shortcode()
    206  *
    207  * @param array  $matches The RegEx matches from the provided regex when calling wp_embed_register_handler().
    208  * @param array  $attr    Embed attributes.
    209  * @param string $url     The original URL that was matched by the regex.
    210  * @param array  $rawattr The original unmodified attributes.
    211  * @return string The embed HTML.
    212  */
    213 function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
    214     // If the user supplied a fixed width AND height, use it
    215     if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {
    216         $width  = (int) $rawattr['width'];
    217         $height = (int) $rawattr['height'];
    218     } else {
    219         list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );
    220     }
    221 
    222     /**
    223      * Filters the Google Video embed output.
    224      *
    225      * @since 2.9.0
    226      *
    227      * @param string $html    Google Video HTML embed markup.
    228      * @param array  $matches The RegEx matches from the provided regex.
    229      * @param array  $attr    An array of embed attributes.
    230      * @param string $url     The original URL that was matched by the regex.
    231      * @param array  $rawattr The original unmodified attributes.
    232      */
    233     return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&amp;hl=en&amp;fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always" />', $matches, $attr, $url, $rawattr );
    234195}
    235196
Note: See TracChangeset for help on using the changeset viewer.