Ticket #31637: 31637.2.diff
File 31637.2.diff, 1.4 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-press-this.php
926 926 $link = $data['_links']['shortlink']; 927 927 } 928 928 929 // If canonical link is from root (starts with /, but not //), as Vimeo.com does, be sure to fully qualify it. 930 // USe $data['u'] to define site root, because we know we force users to have them start with http[s]. 931 if ( preg_match( '/^[\/]{1}[^\/]+/', $link ) ) { 932 $link = preg_replace( '/^(https?:\/\/[^\/]+)(\/.*)?$/', '\1', $data['u'] ) . $link; 933 } 934 929 935 return $link; 930 936 } 931 937 … … 1001 1007 ' <em><a href="%1$s">%2$s</a></em></p>', 1002 1008 ); 1003 1009 1010 $url = $this->get_canonical_link( $data ); 1011 $canonical_embed = $this->_limit_embed( $url ); 1012 1013 // Try to auto-embed if on service-specific page 1014 if ( ! empty( $canonical_embed ) ) { 1015 $default_html['quote'] = '[embed]' . $canonical_embed . '[/embed]<p>%1$s</p>'; 1016 } 1017 1004 1018 /** 1005 1019 * Filter the default HTML for the Press This editor. 1006 1020 * … … 1019 1033 // Add source attribution if there is one available. 1020 1034 if ( ! empty( $default_html['link'] ) ) { 1021 1035 $title = $this->get_suggested_title( $data ); 1022 $url = $this->get_canonical_link( $data );1023 1036 1024 1037 if ( ! $title ) { 1025 1038 $title = $this->get_source_site_name( $data );