From d0fab598e7129976e501f00ae47a1a9233464e99 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 12 Jan 2015 00:02:31 +0000 Subject: [PATCH] In `get_avatar()`, revert the `` tag attributes to using single quotes, instead of double quotes. This behaviour was changed in [31107], but caused problems for code that attempted to parse the `` tag. See #21195 git-svn-id: https://develop.svn.wordpress.org/trunk@31152 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/pluggable.php | 2 +- tests/phpunit/tests/avatar.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index 0c871388b2..468b92610e 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -2181,7 +2181,7 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = } $avatar = sprintf( - '%s', + "%s", esc_attr( $args['alt'] ), esc_url( $url ), esc_attr( join( ' ', $class ) ), diff --git a/tests/phpunit/tests/avatar.php b/tests/phpunit/tests/avatar.php index 50aca9cd5f..b9a94ee003 100755 --- a/tests/phpunit/tests/avatar.php +++ b/tests/phpunit/tests/avatar.php @@ -166,30 +166,30 @@ class Tests_Avatar extends WP_UnitTestCase { public function test_get_avatar() { $img = get_avatar( 1 ); - $this->assertEquals( preg_match( '|^[^$|', $img ), 1 ); + $this->assertEquals( preg_match( "|^[^$|", $img ), 1 ); } public function test_get_avatar_size() { $size = '100'; $img = get_avatar( 1, $size ); - $this->assertEquals( preg_match( '|^assertEquals( preg_match( "|^assertEquals( preg_match( '|^' . $alt . 'assertEquals( preg_match( "|^$alt $class ) ); - $this->assertEquals( preg_match( '|^assertEquals( preg_match( "|^ true ) ); - $this->assertEquals( preg_match( '|^assertEquals( preg_match( "|^