summaryrefslogtreecommitdiffstats
path: root/wp-includes/shortcodes.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/shortcodes.php
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/shortcodes.php')
-rw-r--r--wp-includes/shortcodes.php16
1 files changed, 8 insertions, 8 deletions
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;