Ticket #35022: 35022.2.patch
File 35022.2.patch, 2.2 KB (added by , 9 years ago) |
---|
-
src/wp-includes/formatting.php
216 216 217 217 // Look for shortcodes and HTML elements. 218 218 219 preg_match_all( '@\[/?([^ <>&/\[\]\x00-\x20=]++)@', $text, $matches );219 preg_match_all( '@\[/?([^' . WP_SHORTCODE_NAME_TERMINATORS . ']++)@u', $text, $matches ); 220 220 $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] ); 221 221 $found_shortcodes = ! empty( $tagnames ); 222 222 $shortcode_regex = $found_shortcodes ? _get_wptexturize_shortcode_regex( $tagnames ) : ''; -
src/wp-includes/shortcodes.php
41 41 */ 42 42 $shortcode_tags = array(); 43 43 44 define( 'WP_SHORTCODE_NAME_TERMINATORS', '<>&\/\[\]\x00-\x20=\x{00a0}' ); 45 44 46 /** 45 47 * Add hook for shortcode tag. 46 48 * … … 95 97 return; 96 98 } 97 99 98 if ( 0 !== preg_match( '@[ <>&/\[\]\x00-\x20=]@', $tag ) ) {100 if ( 0 !== preg_match( '@[' . WP_SHORTCODE_NAME_TERMINATORS . ']@u', $tag ) ) { 99 101 /* translators: 1: shortcode name, 2: space separated list of reserved characters */ 100 102 $message = sprintf( __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ), $tag, '& / < > [ ] =' ); 101 103 _doing_it_wrong( __FUNCTION__, $message, '4.4.0' ); … … 210 212 return $content; 211 213 212 214 // Find all registered tag names in $content. 213 preg_match_all( '@\[([^ <>&/\[\]\x00-\x20=]++)@', $content, $matches );215 preg_match_all( '@\[([^' . WP_SHORTCODE_NAME_TERMINATORS . ']++)@u', $content, $matches ); 214 216 $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] ); 215 217 216 218 if ( empty( $tagnames ) ) { … … 578 580 return $content; 579 581 580 582 // Find all registered tag names in $content. 581 preg_match_all( '@\[([^ <>&/\[\]\x00-\x20=]++)@', $content, $matches );583 preg_match_all( '@\[([^' . WP_SHORTCODE_NAME_TERMINATORS . ']++)@u', $content, $matches ); 582 584 $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] ); 583 585 584 586 if ( empty( $tagnames ) ) {