Changeset 32828 for trunk/src/wp-admin/includes/class-wp-press-this.php
- Timestamp:
- 06/18/2015 12:11:30 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-press-this.php
r32827 r32828 445 445 $src = $this->_limit_url( $src ); 446 446 447 if ( empty( $src ) ) 448 return ''; 449 447 450 if ( preg_match( '/\/\/(m|www)\.youtube\.com\/(embed|v)\/([^\?]+)\?.+$/', $src, $src_matches ) ) { 448 451 // Embedded Youtube videos (www or mobile) … … 460 463 // Embedded Daily Motion videos 461 464 $src = 'https://www.dailymotion.com/video/' . $src_matches[2]; 462 } else if ( ! preg_match( '/\/\/(m|www)\.youtube\.com\/watch\?/', $src ) // Youtube video page (www or mobile) 463 && ! preg_match( '/\/youtu\.be\/.+$/', $src ) // Youtu.be video page 464 && ! preg_match( '/\/\/vimeo\.com\/[\d]+$/', $src ) // Vimeo video page 465 && ! preg_match( '/\/\/(www\.)?dailymotion\.com\/video\/.+$/', $src ) // Daily Motion video page 466 && ! preg_match( '/\/\/soundcloud\.com\/.+$/', $src ) // SoundCloud audio page 467 && ! preg_match( '/\/\/twitter\.com\/[^\/]+\/status\/[\d]+$/', $src ) // Twitter status page 468 && ! preg_match( '/\/\/vine\.co\/v\/[^\/]+/', $src ) ) { // Vine video page 469 $src = ''; 465 } else { 466 require_once( ABSPATH . WPINC . '/class-oembed.php' ); 467 $oembed = _wp_oembed_get_object(); 468 469 if ( ! $oembed->get_provider( $src, array( 'discover' => false ) ) ) { 470 $src = ''; 471 } 470 472 } 471 473 … … 934 936 $selected_embeds = array(); 935 937 938 // Make sure to add the Pressed page if it's a valid oembed itself 939 if ( ! empty ( $data['u'] ) && $this->_limit_embed( $data['u'] ) ) { 940 $data['_embeds'][] = $data['u']; 941 } 942 936 943 if ( ! empty( $data['_embeds'] ) ) { 937 944 foreach( $data['_embeds'] as $src ) { … … 1098 1105 $default_html = array( 'quote' => '', 'link' => '', 'embed' => '' ); 1099 1106 1100 require_once( ABSPATH . WPINC . '/class-oembed.php' ); 1101 $oembed = _wp_oembed_get_object(); 1102 1103 if ( ! empty( $data['u'] ) && $oembed->get_provider( $data['u'], array( 'discover' => false ) ) ) { 1107 if ( $this->_limit_embed( $data['u'] ) ) { 1104 1108 $default_html['embed'] = '<p>[embed]' . $data['u'] . '[/embed]</p>'; 1105 1109
Note: See TracChangeset
for help on using the changeset viewer.