Changeset 7006 for trunk/src/includes/common/formatting.php
- Timestamp:
- 11/24/2019 01:38:37 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/formatting.php
r6924 r7006 97 97 */ 98 98 function bbp_kses_data( $data = '' ) { 99 return wp_kses( $data 99 return wp_kses( $data, bbp_kses_allowed_tags() ); 100 100 } 101 101 … … 112 112 function bbp_code_trick( $content = '' ) { 113 113 $content = str_replace( array( "\r\n", "\r" ), "\n", $content ); 114 $content = preg_replace_callback( "|(`)(.*?)`|", 'bbp_encode_callback', $content );114 $content = preg_replace_callback('|(`)(.*?)`|', 'bbp_encode_callback', $content ); 115 115 $content = preg_replace_callback( "!(^|\n)`(.*?)`!s", 'bbp_encode_callback', $content ); 116 116 … … 131 131 // Setup variables 132 132 $openers = array( '<p>', '<br />' ); 133 $content = preg_replace_callback( "!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s", 'bbp_decode_callback', $content );133 $content = preg_replace_callback( '!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s', 'bbp_decode_callback', $content ); 134 134 135 135 // Do the do … … 197 197 198 198 // Trim inline code, not pre blocks (to prevent removing indentation) 199 if ( "`"=== $matches[1] ) {199 if ( '`' === $matches[1] ) { 200 200 $content = trim( $matches[2] ); 201 201 } else { … … 215 215 216 216 // Wrap blocks in pre tags 217 if ( "`"!== $matches[1] ) {217 if ('`' !== $matches[1] ) { 218 218 $content = "\n<pre>" . $content . "</pre>\n"; 219 219 } … … 235 235 // Setup variables 236 236 $trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) ); 237 $amps = array( '&', '&', '&' );238 $single = array( ''', ''' );237 $amps = array( '&', '&', '&' ); 238 $single = array( ''', ''' ); 239 239 $content = $matches[2]; 240 240 $content = strtr( $content, $trans_table ); … … 314 314 // Bail on links that match the current domain 315 315 if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'http' ) ) . ')%i', $text ) || 316 316 preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'https' ) ) . ')%i', $text ) 317 317 ) { 318 318 return "<a {$text}>"; … … 393 393 394 394 // Cleanup of accidental links within links 395 return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', "$1$3$4</a>", $r );395 return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', '$1$3$4</a>', $r ); 396 396 } 397 397
Note: See TracChangeset
for help on using the changeset viewer.