]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-oembed.php
WordPress 3.9.1-scripts
[autoinstalls/wordpress.git] / wp-includes / class-oembed.php
index cc36b2e69ff686b9d178226433d8aeecfe4126fb..353837ff22770801b8a2c31ecdc32bbc842db13e 100644 (file)
@@ -27,33 +27,37 @@ class WP_oEmbed {
         */
        function __construct() {
                $providers = array(
-                       '#https?://(www\.)?youtube\.com/watch.*#i'           => array( 'http://www.youtube.com/oembed',                     true  ),
-                       'http://youtu.be/*'                                  => array( 'http://www.youtube.com/oembed',                     false ),
-                       'http://blip.tv/*'                                   => array( 'http://blip.tv/oembed/',                            false ),
-                       '#https?://(www\.)?vimeo\.com/.*#i'                  => array( 'http://vimeo.com/api/oembed.{format}',              true  ),
-                       '#https?://(www\.)?dailymotion\.com/.*#i'            => array( 'http://www.dailymotion.com/services/oembed',        true  ),
-                       'http://dai.ly/*'                                    => array( 'http://www.dailymotion.com/services/oembed',        false ),
-                       '#https?://(www\.)?flickr\.com/.*#i'                 => array( 'http://www.flickr.com/services/oembed/',            true  ),
-                       'http://flic.kr/*'                                   => array( 'http://www.flickr.com/services/oembed/',            false ),
-                       '#https?://(.+\.)?smugmug\.com/.*#i'                 => array( 'http://api.smugmug.com/services/oembed/',           true  ),
-                       '#https?://(www\.)?hulu\.com/watch/.*#i'             => array( 'http://www.hulu.com/api/oembed.{format}',           true  ),
-                       '#https?://(www\.)?viddler\.com/.*#i'                => array( 'http://lab.viddler.com/services/oembed/',           true  ),
-                       'http://qik.com/*'                                   => array( 'http://qik.com/api/oembed.{format}',                false ),
-                       'http://revision3.com/*'                             => array( 'http://revision3.com/api/oembed/',                  false ),
-                       'http://i*.photobucket.com/albums/*'                 => array( 'http://photobucket.com/oembed',                     false ),
-                       'http://gi*.photobucket.com/groups/*'                => array( 'http://photobucket.com/oembed',                     false ),
-                       '#https?://(www\.)?scribd\.com/.*#i'                 => array( 'http://www.scribd.com/services/oembed',             true  ),
-                       'http://wordpress.tv/*'                              => array( 'http://wordpress.tv/oembed/',                       false ),
-                       '#https?://(.+\.)?polldaddy\.com/.*#i'               => array( 'http://polldaddy.com/oembed/',                      true  ),
-                       '#https?://(www\.)?funnyordie\.com/videos/.*#i'      => array( 'http://www.funnyordie.com/oembed',                  true  ),
-                       '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i'=> array( 'http://api.twitter.com/1/statuses/oembed.{format}', true  ),
-                       '#https?://(www\.)?soundcloud\.com/.*#i'             => array( 'http://soundcloud.com/oembed',                      true  ),
-                       '#https?://(www\.)?slideshare\.net/*#'               => array( 'http://www.slideshare.net/api/oembed/2',            true  ),
-                       '#http://instagr(\.am|am\.com)/p/.*#i'               => array( 'http://api.instagram.com/oembed',                   true  ),
-                       '#https?://(www\.)?rdio\.com/.*#i'                   => array( 'http://www.rdio.com/api/oembed/',                   true  ),
-                       '#https?://rd\.io/x/.*#i'                            => array( 'http://www.rdio.com/api/oembed/',                   true  ),
-                       '#https?://(open|play)\.spotify\.com/.*#i'           => array( 'https://embed.spotify.com/oembed/',                 true  ),
+                       '#http://(www\.)?youtube\.com/watch.*#i'              => array( 'http://www.youtube.com/oembed',                      true  ),
+                       '#https://(www\.)?youtube\.com/watch.*#i'             => array( 'http://www.youtube.com/oembed?scheme=https',         true  ),
+                       '#http://youtu\.be/.*#i'                              => array( 'http://www.youtube.com/oembed',                      true  ),
+                       '#https://youtu\.be/.*#i'                             => array( 'http://www.youtube.com/oembed?scheme=https',         true  ),
+                       'http://blip.tv/*'                                    => array( 'http://blip.tv/oembed/',                             false ),
+                       '#https?://(.+\.)?vimeo\.com/.*#i'                    => array( 'http://vimeo.com/api/oembed.{format}',               true  ),
+                       '#https?://(www\.)?dailymotion\.com/.*#i'             => array( 'http://www.dailymotion.com/services/oembed',         true  ),
+                       'http://dai.ly/*'                                     => array( 'http://www.dailymotion.com/services/oembed',         false ),
+                       '#https?://(www\.)?flickr\.com/.*#i'                  => array( 'http://www.flickr.com/services/oembed/',             true  ),
+                       'http://flic.kr/*'                                    => array( 'http://www.flickr.com/services/oembed/',             false ),
+                       '#https?://(.+\.)?smugmug\.com/.*#i'                  => array( 'http://api.smugmug.com/services/oembed/',            true  ),
+                       '#https?://(www\.)?hulu\.com/watch/.*#i'              => array( 'http://www.hulu.com/api/oembed.{format}',            true  ),
+                       '#https?://(www\.)?viddler\.com/.*#i'                 => array( 'http://lab.viddler.com/services/oembed/',            true  ),
+                       'http://revision3.com/*'                              => array( 'http://revision3.com/api/oembed/',                   false ),
+                       'http://i*.photobucket.com/albums/*'                  => array( 'http://photobucket.com/oembed',                      false ),
+                       'http://gi*.photobucket.com/groups/*'                 => array( 'http://photobucket.com/oembed',                      false ),
+                       '#https?://(www\.)?scribd\.com/.*#i'                  => array( 'http://www.scribd.com/services/oembed',              true  ),
+                       'http://wordpress.tv/*'                               => array( 'http://wordpress.tv/oembed/',                        false ),
+                       '#https?://(.+\.)?polldaddy\.com/.*#i'                => array( 'http://polldaddy.com/oembed/',                       true  ),
+                       '#https?://(www\.)?funnyordie\.com/videos/.*#i'       => array( 'http://www.funnyordie.com/oembed',                   true  ),
+                       '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' => array( 'https://api.twitter.com/1/statuses/oembed.{format}', true  ),
+                       '#https?://(www\.)?soundcloud\.com/.*#i'              => array( 'http://soundcloud.com/oembed',                       true  ),
+                       '#https?://(www\.)?slideshare\.net/*#'                => array( 'http://www.slideshare.net/api/oembed/2',             true  ),
+                       '#http://instagr(\.am|am\.com)/p/.*#i'                => array( 'http://api.instagram.com/oembed',                    true  ),
+                       '#https?://(www\.)?rdio\.com/.*#i'                    => array( 'http://www.rdio.com/api/oembed/',                    true  ),
+                       '#https?://rd\.io/x/.*#i'                             => array( 'http://www.rdio.com/api/oembed/',                    true  ),
+                       '#https?://(open|play)\.spotify\.com/.*#i'            => array( 'https://embed.spotify.com/oembed/',                  true  ),
+                       '#https?://(.+\.)?imgur\.com/.*#i'                    => array( 'http://api.imgur.com/oembed',                        true  ),
+                       '#https?://(www\.)?meetu(\.ps|p\.com)/.*#i'           => array( 'http://api.meetup.com/oembed',                       true  ),
                );
+
                /**
                 * Filter the list of oEmbed providers.
                 *
@@ -132,7 +136,8 @@ class WP_oEmbed {
                $providers = array();
 
                // Fetch URL content
-               if ( $html = wp_remote_retrieve_body( wp_safe_remote_get( $url ) ) ) {
+               $request = wp_safe_remote_get( $url );
+               if ( $html = wp_remote_retrieve_body( $request ) ) {
 
                        /**
                         * Filter the link types that contain oEmbed provider URLs.