Ticket #31645: 31645.5.patch
File 31645.5.patch, 1.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-press-this.php
561 561 foreach ( $items as $value ) { 562 562 if ( preg_match( '/rel=["\'](canonical|shortlink|icon)["\']/i', $value, $matches_rel ) && preg_match( '/href=[\'"]([^\'" ]+)[\'"]/i', $value, $matches_url ) ) { 563 563 $rel = $matches_rel[1]; 564 $url = $ this->_limit_url( $matches_url[1] );564 $url = $matches_url[1]; 565 565 566 if ( $rel === 'canonical' && ! preg_match( '%^(?:https?:)?//%i', $url ) ) { 567 continue; 568 } 569 570 $url = $this->_limit_url( $url ); 571 566 572 if ( ! empty( $url ) && empty( $data['_links'][ $rel ] ) ) { 567 573 $data['_links'][ $rel ] = $url; 568 574 } … … 663 669 $data = $this->_process_meta_entry( $key, $value, $data ); 664 670 } 665 671 } else { 672 if ( $key === 'canonical' && ! preg_match( '%^(?:https?:)?//%i', $value ) ) { 673 continue; 674 } 675 666 676 if ( in_array( $key, array( 'canonical', 'shortlink', 'icon' ), true ) ) { 667 677 $data[ $type ][ $key ] = $this->_limit_url( wp_unslash( $value ) ); 668 678 }