Make WordPress Core

Changeset 21915


Ignore:
Timestamp:
09/19/2012 01:46:05 PM (12 years ago)
Author:
ryan
Message:

Handle https for all oembed providers. Props johnjamesjacoby, gluten. fixes #20102

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-oembed.php

    r21840 r21915  
    3131        // Add to this list using the wp_oembed_add_provider() function (see its PHPDoc for details).
    3232        $this->providers = apply_filters( 'oembed_providers', array(
    33             '#http://(www\.)?youtube.com/watch.*#i'              => array( 'http://www.youtube.com/oembed',                     true  ),
     33            '#https?://(www\.)?youtube.com/watch.*#i'            => array( 'http://www.youtube.com/oembed',                     true  ),
    3434            'http://youtu.be/*'                                  => array( 'http://www.youtube.com/oembed',                     false ),
    3535            'http://blip.tv/*'                                   => array( 'http://blip.tv/oembed/',                            false ),
    36             '#http://(www\.)?vimeo\.com/.*#i'                    => array( 'http://vimeo.com/api/oembed.{format}',              true  ),
    37             '#http://(www\.)?dailymotion\.com/.*#i'              => array( 'http://www.dailymotion.com/services/oembed',        true  ),
    38             '#http://(www\.)?flickr\.com/.*#i'                   => array( 'http://www.flickr.com/services/oembed/',            true  ),
    39             '#http://(.+\.)?smugmug\.com/.*#i'                   => array( 'http://api.smugmug.com/services/oembed/',           true  ),
    40             '#http://(www\.)?hulu\.com/watch/.*#i'               => array( 'http://www.hulu.com/api/oembed.{format}',           true  ),
    41             '#http://(www\.)?viddler\.com/.*#i'                  => array( 'http://lab.viddler.com/services/oembed/',           true  ),
     36            '#https?://(www\.)?vimeo\.com/.*#i'                  => array( 'http://vimeo.com/api/oembed.{format}',              true  ),
     37            '#https?://(www\.)?dailymotion\.com/.*#i'            => array( 'http://www.dailymotion.com/services/oembed',        true  ),
     38            '#https?://(www\.)?flickr\.com/.*#i'                 => array( 'http://www.flickr.com/services/oembed/',            true  ),
     39            '#https?://(.+\.)?smugmug\.com/.*#i'                 => array( 'http://api.smugmug.com/services/oembed/',           true  ),
     40            '#https?://(www\.)?hulu\.com/watch/.*#i'             => array( 'http://www.hulu.com/api/oembed.{format}',           true  ),
     41            '#https?://(www\.)?viddler\.com/.*#i'                => array( 'http://lab.viddler.com/services/oembed/',           true  ),
    4242            'http://qik.com/*'                                   => array( 'http://qik.com/api/oembed.{format}',                false ),
    4343            'http://revision3.com/*'                             => array( 'http://revision3.com/api/oembed/',                  false ),
    4444            'http://i*.photobucket.com/albums/*'                 => array( 'http://photobucket.com/oembed',                     false ),
    4545            'http://gi*.photobucket.com/groups/*'                => array( 'http://photobucket.com/oembed',                     false ),
    46             '#http://(www\.)?scribd\.com/.*#i'                   => array( 'http://www.scribd.com/services/oembed',             true  ),
     46            '#https?://(www\.)?scribd\.com/.*#i'                 => array( 'http://www.scribd.com/services/oembed',             true  ),
    4747            'http://wordpress.tv/*'                              => array( 'http://wordpress.tv/oembed/',                       false ),
    48             '#http://(.+\.)?polldaddy\.com/.*#i'                 => array( 'http://polldaddy.com/oembed/',                      true  ),
    49             '#http://(www\.)?funnyordie\.com/videos/.*#i'        => array( 'http://www.funnyordie.com/oembed',                  true  ),
     48            '#https?://(.+\.)?polldaddy\.com/.*#i'               => array( 'http://polldaddy.com/oembed/',                      true  ),
     49            '#https?://(www\.)?funnyordie\.com/videos/.*#i'      => array( 'http://www.funnyordie.com/oembed',                  true  ),
    5050            '#https?://(www\.)?twitter.com/.+?/status(es)?/.*#i' => array( 'http://api.twitter.com/1/statuses/oembed.{format}', true  ),
    5151        ) );
     
    7676
    7777            // Turn the asterisk-type provider URLs into regex
    78             if ( !$regex )
     78            if ( !$regex ) {
    7979                $matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
     80                $matchmask = preg_replace( '|^#http\\\://|', '#https?\://', $matchmask );
     81            }
    8082
    8183            if ( preg_match( $matchmask, $url ) ) {
Note: See TracChangeset for help on using the changeset viewer.