From 9fa0ec4e94f82cadd5cd0a0a488f2e5682a5cc81 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 30 Nov 2013 22:39:10 +0000 Subject: [PATCH] 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 --- wp-includes/formatting.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index c0ebf6b596..c0e0c81a91 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1862,7 +1862,6 @@ function translate_smiley( $matches ) { $smiley = trim( reset( $matches ) ); $img = $wpsmiliestrans[ $smiley ]; - $smiley_masked = esc_attr( $smiley ); /** * 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() ); - return " $smiley_masked "; + return sprintf( ' %s ', esc_url( $src_url ), esc_attr( $smiley ) ); } /**