Ticket #35022: 35022.patch
File 35022.patch, 1.6 KB (added by , 8 years ago) |
---|
-
trunk/wp-includes/shortcodes.php
95 95 return; 96 96 } 97 97 98 if ( 0 !== preg_match( '@[<>&/\[\]\ x00-\x20=]@', $tag ) ) {98 if ( 0 !== preg_match( '@[<>&/\[\]\s=]@u', $tag ) ) { 99 99 /* translators: 1: shortcode name, 2: space separated list of reserved characters */ 100 100 $message = sprintf( __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ), $tag, '& / < > [ ] =' ); 101 101 _doing_it_wrong( __FUNCTION__, $message, '4.4.0' ); … … 210 210 return $content; 211 211 212 212 // Find all registered tag names in $content. 213 preg_match_all( '@\[([^<>&/\[\]\ x00-\x20=]++)@', $content, $matches );213 preg_match_all( '@\[([^<>&/\[\]\s=]++)@u', $content, $matches ); 214 214 $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] ); 215 215 216 216 if ( empty( $tagnames ) ) { … … 481 481 function shortcode_parse_atts($text) { 482 482 $atts = array(); 483 483 $pattern = get_shortcode_atts_regex(); 484 $text = preg_replace('/”|″/i',"\x22",$text); 484 485 $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); 485 486 if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { 486 487 foreach ($match as $m) { … … 578 579 return $content; 579 580 580 581 // Find all registered tag names in $content. 581 preg_match_all( '@\[([^<>&/\[\]\ x00-\x20=]++)@', $content, $matches );582 preg_match_all( '@\[([^<>&/\[\]\s=]++)@u', $content, $matches ); 582 583 $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] ); 583 584 584 585 if ( empty( $tagnames ) ) {