X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/46588ee871246a923d972538dbc93b26f4fda932..58b0523c599c731e868bd4bc05b0d686a98d254f:/wp-includes/shortcodes.php diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 531a1fa1..810db200 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -457,6 +457,15 @@ function shortcode_parse_atts($text) { elseif (isset($m[8])) $atts[] = stripcslashes($m[8]); } + + // Reject any unclosed HTML elements + foreach( $atts as &$value ) { + if ( false !== strpos( $value, '<' ) ) { + if ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) { + $value = ''; + } + } + } } else { $atts = ltrim($text); }