Escape smiley URL in translate_smiley().
props simonwheatley. fixes #25529. Built from https://develop.svn.wordpress.org/trunk@26487 git-svn-id: http://core.svn.wordpress.org/trunk@26384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b6e094c748
commit
9fa0ec4e94
|
@ -1862,7 +1862,6 @@ function translate_smiley( $matches ) {
|
||||||
|
|
||||||
$smiley = trim( reset( $matches ) );
|
$smiley = trim( reset( $matches ) );
|
||||||
$img = $wpsmiliestrans[ $smiley ];
|
$img = $wpsmiliestrans[ $smiley ];
|
||||||
$smiley_masked = esc_attr( $smiley );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the Smiley image URL before it's used in the image element.
|
* Filter the Smiley image URL before it's used in the image element.
|
||||||
|
@ -1875,7 +1874,7 @@ function translate_smiley( $matches ) {
|
||||||
*/
|
*/
|
||||||
$src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
|
$src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
|
||||||
|
|
||||||
return " <img src='$src_url' alt='$smiley_masked' class='wp-smiley' /> ";
|
return sprintf( ' <img src="%s" alt="%s" class="wp-smiley" /> ', esc_url( $src_url ), esc_attr( $smiley ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue