Changeset 46369 for trunk/src/wp-includes/shortcodes.php
- Timestamp:
- 10/01/2019 03:41:58 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/shortcodes.php
r46232 r46369 489 489 * 490 490 * @since 2.5.0 491 * 492 * @param string $text 491 * @since 5.3.0 Support of a full shortcode input. 492 * 493 * @param string $text Any single shortcode of any format or key/value pair string. 493 494 * @return array|string List of attribute values. 494 495 * Returns empty array if trim( $text ) == '""'. … … 499 500 $atts = array(); 500 501 $pattern = get_shortcode_atts_regex(); 501 $text = preg_replace( "/[\x{00a0}\x{200b}]+/u", ' ', $text ); 502 $text = trim( preg_replace( "/[\x{00a0}\x{200b}]+/u", ' ', $text ) ); 503 504 // Remove everything but attributes from shortcode. 505 if ( preg_match( '#^\[[\w-]+([^\]]*?)\/?\]#', $text, $matches ) ) { 506 $text = $matches[1]; 507 } 508 502 509 if ( preg_match_all( $pattern, $text, $match, PREG_SET_ORDER ) ) { 503 510 foreach ( $match as $m ) { … … 517 524 } 518 525 519 // Reject any unclosed HTML elements 526 // Reject any unclosed HTML elements. 520 527 foreach ( $atts as &$value ) { 521 528 if ( false !== strpos( $value, '<' ) ) { … … 528 535 $atts = ltrim( $text ); 529 536 } 537 530 538 return $atts; 531 539 }
Note: See TracChangeset
for help on using the changeset viewer.