From 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:57:26 +0200 Subject: Adding upstream version 6.5+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/shortcodes.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'wp-includes/shortcodes.php') diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 24df21d..75e489f 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -362,7 +362,7 @@ function get_shortcode_regex( $tagnames = null ) { . '\\[\\/\\2\\]' // Closing shortcode tag. . ')?' . ')' - . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]]. + . '(\\]?)'; // 6: Optional second closing bracket for escaping shortcodes: [[tag]]. // phpcs:enable } @@ -385,7 +385,7 @@ function get_shortcode_regex( $tagnames = null ) { * @type string $3 Shortcode arguments list. * @type string $4 Optional self closing slash. * @type string $5 Content of a shortcode when it wraps some content. - * @type string $6 Optional second closing brocket for escaping shortcodes. + * @type string $6 Optional second closing bracket for escaping shortcodes. * } * @return string Shortcode output. */ @@ -504,7 +504,7 @@ function do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames ) { $element = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $element ); } - // Looks like we found some crazy unfiltered HTML. Skipping it for sanity. + // Looks like we found some unexpected unfiltered HTML. Skipping it for confidence. $element = strtr( $element, $trans ); continue; } @@ -600,11 +600,13 @@ function get_shortcode_atts_regex() { * retrieval of the attributes, since all attributes have to be known. * * @since 2.5.0 + * @since 6.5.0 The function now always returns an empty array, + * even if the original arguments string cannot be parsed or is empty. * * @param string $text Shortcode arguments list. - * @return array|string Array of attribute values keyed by attribute name. - * Returns empty array if there are no attributes. - * Returns the original arguments string if it cannot be parsed. + * @return array Array of attribute values keyed by attribute name. + * Returns empty array if there are no attributes + * or if the original arguments string cannot be parsed. */ function shortcode_parse_atts( $text ) { $atts = array(); @@ -635,8 +637,6 @@ function shortcode_parse_atts( $text ) { } } } - } else { - $atts = ltrim( $text ); } return $atts; -- cgit v1.2.3