Changeset 12118 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-markdown/inc/class-editor.php
- Timestamp:
- 10/13/2022 12:09:10 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-markdown/inc/class-editor.php
r10140 r12118 181 181 return ''; 182 182 } 183 if ( 'github.com' !== parse_url( $markdown_source, PHP_URL_HOST ) 184 || false !== stripos( $markdown_source, '/edit/master/') ) {183 184 if ( 'github.com' !== parse_url( $markdown_source, PHP_URL_HOST ) ) { 185 185 return $markdown_source; 186 186 } 187 $markdown_source = str_replace( '/blob/master/', '/edit/master/', $markdown_source ); 187 188 if ( preg_match( '!^https?://github.com/(?P<repo>[^/]+/[^/]+)/(?P<editblob>blob|edit)/(?P<branchfile>.*)$!i', $markdown_source, $m ) ) { 189 if ( 'edit' === $m['editblob'] ) { 190 return $markdown_source; 191 } 192 193 $markdown_source = "https://github.com/{$m['repo']}/edit/{$m['branchfile']}"; 194 } 188 195 189 196 return apply_filters( 'wporg_markdown_edit_link', $markdown_source, $post_id );
Note: See TracChangeset
for help on using the changeset viewer.