Skip to content

Commit

Permalink
Add missing charset arg for html_entity_decode()
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Nov 8, 2019
1 parent 714068f commit 7bcd9f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test-class-wp-web-app-manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ public function test_get_theme_color() {
*/
public function test_get_manifest() {
$this->mock_site_icon();
$blogname = 'PWA & Test "First" and \'second\'';
$blogname = 'PWA & Test "First" and \'second\' and “third”';
update_option( 'blogname', $blogname );
$actual_manifest = $this->instance->get_manifest();

// Verify that there are now entities.
$this->assertEquals( 'PWA & Test "First" and 'second'', get_option( 'blogname' ) );
$this->assertEquals( 'PWA & Test "First" and 'second' and “third”', get_option( 'blogname' ) );

$expected_manifest = array(
'background_color' => WP_Web_App_Manifest::FALLBACK_THEME_COLOR,
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/class-wp-web-app-manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function get_theme_color() {
*/
public function get_manifest() {
$manifest = array(
'name' => html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES, '' ),
'name' => html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES, 'utf-8' ),
'start_url' => home_url( '/' ),
'display' => 'minimal-ui',
'dir' => is_rtl() ? 'rtl' : 'ltr',
Expand Down Expand Up @@ -158,7 +158,7 @@ public function get_manifest() {
$manifest['theme_color'] = $theme_color;
}

$description = html_entity_decode( get_bloginfo( 'description' ), ENT_QUOTES, '' );
$description = html_entity_decode( get_bloginfo( 'description' ), ENT_QUOTES, 'utf-8' );
if ( $description ) {
$manifest['description'] = $description;
}
Expand Down

0 comments on commit 7bcd9f2

Please sign in to comment.