WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#30011 closed defect (bug) (fixed)

Twenty Fifteen: Bug in content display on content-none.php

Reported by: dmchale Owned by: iandstewart
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

When a site has no posts and the admin is viewing the homepage, the use of esc_html__() on Line 21 is breaking the intended display of the message to the site admin.

Because the message contains html in the anchor tag, the html itself is being displayed on the screen rather than an actual rendered, clickable link.

Replace with __() function call instead - see attached screens and patch.

Broken in 2015: http://www.binarytemplar.com/wp-content/uploads/2014/10/01_2015_broken.jpg

Working in 2014: http://www.binarytemplar.com/wp-content/uploads/2014/10/02_2014_working.jpg

Working in 2015 after patch: http://www.binarytemplar.com/wp-content/uploads/2014/10/03_2015_working.jpg

Attachments (2)

content-none-esc-html-fix.patch (2.3 KB) - added by dmchale 4 years ago.
Patch to trunk which fixes /twentyfifteen/content-none.php
content-none-esc-html-fix_revised.patch (864 bytes) - added by dmchale 4 years ago.
Updated patch: should only contain fix for this 1 issue

Download all attachments as: .zip

Change History (7)

@dmchale
4 years ago

Patch to trunk which fixes /twentyfifteen/content-none.php

#1 @ocean90
4 years ago

  • Component changed from Themes to Bundled Theme
  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Review to 4.1

@dmchale

Thanks, you're right. Can you please upload a patch without the other changes? Thanks!

Last edited 4 years ago by ocean90 (previous) (diff)

@dmchale
4 years ago

Updated patch: should only contain fix for this 1 issue

#2 @dmchale
4 years ago

@ocean90

Thanks! Good catch on the patch file, sorry about that. Uploaded revised patch, should be better now.

#3 @ocean90
4 years ago

  • Keywords commit added; needs-refresh removed

#4 @iandstewart
4 years ago

  • Owner set to iandstewart
  • Resolution set to fixed
  • Status changed from new to closed

In 29947:

Twenty Fifteen: correct escaping to render HTML in no-content admin message.

Props dmchale, fixes #30011.

This ticket was mentioned in Slack in #core by dmchale. View the logs.


3 years ago

Note: See TracTickets for help on using tickets.