Changeset 34736
- Timestamp:
- 10/01/2015 05:15:05 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-press-this.php
r33970 r34736 391 391 * Utility method to limit image source URLs. 392 392 * 393 * Excluded URLs include share-this type buttons, loaders, spinners, spacers, W Pinterface images,394 * tiny buttons or thumbs, mathtag.com or quantserve.com images, or the W Pstats gif.393 * Excluded URLs include share-this type buttons, loaders, spinners, spacers, WordPress interface images, 394 * tiny buttons or thumbs, mathtag.com or quantserve.com images, or the WordPress.com stats gif. 395 395 * 396 396 * @ignore … … 403 403 $src = $this->_limit_url( $src ); 404 404 405 if ( preg_match( ' /\/ad[sx]{1}?\//', $src ) ) {405 if ( preg_match( '!/ad[sx]?/!i', $src ) ) { 406 406 // Ads 407 407 return ''; 408 } else if ( preg_match( ' /(\/share-?this[^\.]+?\.[a-z0-9]{3,4})(\?.*)?$/', $src ) ) {408 } else if ( preg_match( '!(/share-?this[^.]+?\.[a-z0-9]{3,4})(\?.*)?$!i', $src ) ) { 409 409 // Share-this type button 410 410 return ''; 411 } else if ( preg_match( ' /\/(spinner|loading|spacer|blank|rss)\.(gif|jpg|png)/', $src ) ) {411 } else if ( preg_match( '!/(spinner|loading|spacer|blank|rss)\.(gif|jpg|png)!i', $src ) ) { 412 412 // Loaders, spinners, spacers 413 413 return ''; 414 } else if ( preg_match( ' /\/([^\.\/]+[-_]{1})?(spinner|loading|spacer|blank)s?([-_]{1}[^\.\/]+)?\.[a-z0-9]{3,4}/', $src ) ) {414 } else if ( preg_match( '!/([^./]+[-_])?(spinner|loading|spacer|blank)s?([-_][^./]+)?\.[a-z0-9]{3,4}!i', $src ) ) { 415 415 // Fancy loaders, spinners, spacers 416 416 return ''; 417 } else if ( preg_match( ' /([^\.\/]+[-_]{1})?thumb[^.]*\.(gif|jpg|png)$/', $src ) ) {417 } else if ( preg_match( '!([^./]+[-_])?thumb[^.]*\.(gif|jpg|png)$!i', $src ) ) { 418 418 // Thumbnails, too small, usually irrelevant to context 419 419 return ''; 420 } else if ( preg_match( '/\/wp-includes\//', $src) ) {421 // Classic W Pinterface images420 } else if ( false !== stripos( $src, '/wp-includes/' ) ) { 421 // Classic WordPress interface images 422 422 return ''; 423 } else if ( preg_match( ' /[^\d]{1}\d{1,2}x\d+\.(gif|jpg|png)$/', $src ) ) {423 } else if ( preg_match( '![^\d]\d{1,2}x\d+\.(gif|jpg|png)$!i', $src ) ) { 424 424 // Most often tiny buttons/thumbs (< 100px wide) 425 425 return ''; 426 } else if ( preg_match( ' /\/pixel\.(mathtag|quantserve)\.com/', $src ) ) {426 } else if ( preg_match( '!/pixel\.(mathtag|quantserve)\.com!i', $src ) ) { 427 427 // See mathtag.com and https://www.quantcast.com/how-we-do-it/iab-standard-measurement/how-we-collect-data/ 428 428 return ''; 429 } else if ( preg_match( ' /\/[gb]\.gif(\?.+)?$/', $src ) ) {430 // Classic WPstats gif429 } else if ( preg_match( '!/[gb]\.gif(\?.+)?$!i', $src ) ) { 430 // WordPress.com stats gif 431 431 return ''; 432 432 } … … 453 453 return ''; 454 454 455 if ( preg_match( ' /\/\/(m|www)\.youtube\.com\/(embed|v)\/([^\?]+)\?.+$/', $src, $src_matches ) ) {455 if ( preg_match( '!//(m|www)\.youtube\.com/(embed|v)/([^?]+)\?.+$!i', $src, $src_matches ) ) { 456 456 // Embedded Youtube videos (www or mobile) 457 457 $src = 'https://www.youtube.com/watch?v=' . $src_matches[3]; 458 } else if ( preg_match( ' /\/\/player\.vimeo\.com\/video\/([\d]+)([\?\/]{1}.*)?$/', $src, $src_matches ) ) {458 } else if ( preg_match( '!//player\.vimeo\.com/video/([\d]+)([?/].*)?$!i', $src, $src_matches ) ) { 459 459 // Embedded Vimeo iframe videos 460 460 $src = 'https://vimeo.com/' . (int) $src_matches[1]; 461 } else if ( preg_match( ' /\/\/vimeo\.com\/moogaloop\.swf\?clip_id=([\d]+)$/', $src, $src_matches ) ) {461 } else if ( preg_match( '!//vimeo\.com/moogaloop\.swf\?clip_id=([\d]+)$!i', $src, $src_matches ) ) { 462 462 // Embedded Vimeo Flash videos 463 463 $src = 'https://vimeo.com/' . (int) $src_matches[1]; 464 } else if ( preg_match( ' /\/\/vine\.co\/v\/([^\/]+)\/embed/', $src, $src_matches ) ) {464 } else if ( preg_match( '!//vine\.co/v/([^/]+)/embed!i', $src, $src_matches ) ) { 465 465 // Embedded Vine videos 466 466 $src = 'https://vine.co/v/' . $src_matches[1]; 467 } else if ( preg_match( ' /\/\/(www\.)?dailymotion\.com\/embed\/video\/([^\/\?]+)([\/\?]{1}.+)?/', $src, $src_matches ) ) {467 } else if ( preg_match( '!//(www\.)?dailymotion\.com/embed/video/([^/?]+)([/?].+)?!i', $src, $src_matches ) ) { 468 468 // Embedded Daily Motion videos 469 469 $src = 'https://www.dailymotion.com/video/' . $src_matches[2];
Note: See TracChangeset
for help on using the changeset viewer.