Changeset 4175
- Timestamp:
- 10/01/2016 04:01:55 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-codexify/wporg-bbp-codexify.php
r3653 r4175 36 36 37 37 function convert_wiki_links( $content ) { 38 if ( strpos( $content, '[[' ) && strpos( $content, ']]' )) {38 if ( strpos( $content, '[[' ) !== false && strpos( $content, ']]' ) !== false ) { 39 39 $content = preg_replace_callback( '%\[\[([ #:\/\w]+)\]\]%', array( $this, 'convert_base_wiki_link' ), $content ); 40 40 $content = preg_replace_callback( '%\[\[([ #:\/\w]+)\|([^\]]+)\]\]%', array( $this, 'convert_vbar_wiki_link' ), $content ); … … 50 50 */ 51 51 public static function convert_base_wiki_link( $matches ) { 52 $ matches[1] = preg_replace( '/[\s]+/', '', trim( $matches[1] ) );53 return '<a href="' . esc_url( self::BASE_URI . strtr( $matches[1], ' ', '_' )) . '">' . esc_html( $matches[1] ) . '</a>';52 $path = preg_replace( '/[\s]+/', '_', trim( $matches[1] ) ); 53 return '<a href="' . esc_url( self::BASE_URI . $path ) . '">' . esc_html( $matches[1] ) . '</a>'; 54 54 } 55 55 … … 62 62 */ 63 63 public static function convert_vbar_wiki_link( $matches ) { 64 $ matches[1]= preg_replace( '/[\s]+/', '_', trim( $matches[1] ) );65 return '<a href="' . esc_url( self::BASE_URI . strtr( $matches[1], ' ', '_' )) . '">' . esc_html( $matches[2] ) . '</a>';64 $path = preg_replace( '/[\s]+/', '_', trim( $matches[1] ) ); 65 return '<a href="' . esc_url( self::BASE_URI . $path ) . '">' . esc_html( $matches[2] ) . '</a>'; 66 66 } 67 67 } }
Note: See TracChangeset
for help on using the changeset viewer.