Shortcodes: Trim whitespace after sanitizing the shortcode output.
props Ankit K Gupta, obenland, miqrogroove. fixes #33259. git-svn-id: https://develop.svn.wordpress.org/trunk@33600 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3f7b1ca2ff
commit
239759914f
@ -399,7 +399,7 @@ function do_shortcodes_in_html_tags( $content, $ignore_html ) {
|
|||||||
if ( $count > 0 ) {
|
if ( $count > 0 ) {
|
||||||
// Sanitize the shortcode output using KSES.
|
// Sanitize the shortcode output using KSES.
|
||||||
$new_attr = wp_kses_one_attr( $new_attr, $elname );
|
$new_attr = wp_kses_one_attr( $new_attr, $elname );
|
||||||
if ( '' !== $new_attr ) {
|
if ( '' !== trim( $new_attr ) ) {
|
||||||
// The shortcode is safe to use now.
|
// The shortcode is safe to use now.
|
||||||
$attr = $new_attr;
|
$attr = $new_attr;
|
||||||
}
|
}
|
||||||
|
@ -418,6 +418,14 @@ EOF;
|
|||||||
'<!--[if lt IE 7]>',
|
'<!--[if lt IE 7]>',
|
||||||
'<!--[if lt IE 7]>',
|
'<!--[if lt IE 7]>',
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'1 <a href="[test-shortcode-tag]"> 2 <a href="[test-shortcode-tag]" >',
|
||||||
|
'1 <a href=""> 2 <a href="" >',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'1 <a noise="[test-shortcode-tag]"> 2 <a noise=" [test-shortcode-tag] " >',
|
||||||
|
'1 <a noise="[test-shortcode-tag]"> 2 <a noise=" [test-shortcode-tag] " >',
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'[gallery title="<div>hello</div>"]',
|
'[gallery title="<div>hello</div>"]',
|
||||||
'',
|
'',
|
||||||
|
Loading…
Reference in New Issue
Block a user