Shortcodes: don't allow unclosed HTML elements in attributes
Built from https://develop.svn.wordpress.org/trunk@34134 git-svn-id: http://core.svn.wordpress.org/trunk@34102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -462,6 +462,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user