Ticket #20102: vimeo-oembed-https.3.diff
File vimeo-oembed-https.3.diff, 4.6 KB (added by , 12 years ago) |
---|
-
wp-includes/class-oembed.php
30 30 // The WP_Embed class disables discovery for non-unfiltered_html users, so only providers in this array will be used for them. 31 31 // Add to this list using the wp_oembed_add_provider() function (see its PHPDoc for details). 32 32 $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 ), 34 34 'http://youtu.be/*' => array( 'http://www.youtube.com/oembed', false ), 35 35 '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 ), 42 42 'http://qik.com/*' => array( 'http://qik.com/api/oembed.{format}', false ), 43 43 'http://revision3.com/*' => array( 'http://revision3.com/api/oembed/', false ), 44 44 'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ), 45 45 '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 ), 47 47 '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 ), 50 50 '#https?://(www\.)?twitter.com/.+?/status(es)?/.*#i' => array( 'http://api.twitter.com/1/statuses/oembed.{format}', true ), 51 51 ) ); 52 52 … … 75 75 list( $providerurl, $regex ) = $data; 76 76 77 77 // Turn the asterisk-type provider URLs into regex 78 if ( !$regex ) 79 $matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i'; 78 if ( !$regex ) { 79 $matchmask = preg_replace( '#^https?://#', '', $matchmask ); 80 $matchmask = '#https?://' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i'; 81 } 80 82 81 83 if ( preg_match( $matchmask, $url ) ) { 82 84 $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML