WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 6 days ago

#49126 reviewing defect (bug)

Update needed in wp-admin/includes/template.php

Reported by: hommealone Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.3.2
Component: Administration Keywords: has-patch needs-refresh
Focuses: administration, coding-standards Cc:

Description

I think an update is needed to the function

_wp_admin_html_begin()

in the file wp-admin/includes/template.php beginning at line 2425.

The output of this function can be seen in the source code of any page in the WordPress admin area, right at the top.

I noticed first that the code contains this:

Wrong:

<html xmlns="http://www.w3.org/1999/xhtml"

Should be:

<html xmlns="https://www.w3.org/1999/xhtml"

But more importantly, perhaps, https://wordpress.org/support/users/joyously/|@joyously notes:

Looking at the URL, even though it redirects to https, it refers to http in its content. The other documents do also, when referencing the xmlns. And, having an XML namespace on a HTML5 document doesn’t even make sense. It should probably be removed entirely, just as the conditional for IE8 should be removed since the browser support is for a minimum of IE11 for quite awhile now.

(See: https://wordpress.org/support/topic/error-in-wp-admin-includes-template-php/ )

Attachments (2)

49126.diff (1.1 KB) - added by diddledan 8 weeks ago.
Remove IE8 conditional and xmlns="" attribute in _wp_admin_html_begin()
49126.2.diff (6.0 KB) - added by diddledan 8 weeks ago.
remove all instances of [if IE 8] fallbacks and xmlns attributes on all <html> tags

Download all attachments as: .zip

Change History (12)

@diddledan
8 weeks ago

Remove IE8 conditional and xmlns="" attribute in _wp_admin_html_begin()

#1 @SergeyBiryukov
8 weeks ago

  • Component changed from General to Administration
  • Milestone changed from Awaiting Review to 5.4
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#2 follow-up: @mukesh27
8 weeks ago

  • Keywords has-patch dev-feedback added

It seems many core files used "http://www.w3.org/1999/xhtml" IE8 code so do we need to remove that code also?

@SergeyBiryukov what is your thought?

#3 in reply to: ↑ 2 @SergeyBiryukov
8 weeks ago

Replying to mukesh27:

It seems many core files used "http://www.w3.org/1999/xhtml" IE8 code so do we need to remove that code also?

Yes, it would make sense to me to remove that consistently, not just in one place.

#4 @mukesh27
8 weeks ago

  • Keywords needs-refresh added

@diddledan Can you please remove code from the other files?

@diddledan
8 weeks ago

remove all instances of [if IE 8] fallbacks and xmlns attributes on all <html> tags

#5 @mukesh27
8 weeks ago

  • Keywords needs-refresh removed

@diddledan Thanks for the update.

Remove needs-refresh keywords.

#8 @valentinbora
12 days ago

  • Keywords commit added; dev-feedback removed

I think this is ready to go.

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


12 days ago

#10 @peterwilsoncc
6 days ago

  • Keywords needs-refresh added; commit removed
  • Milestone changed from 5.4 to 5.5

A quick search of the folders ./src/wp-admin/css,./src/wp-includes/css for .ie8 shows 43 results in 19 files. I excluded *.min.css,*-rtl.css to try an avoid auto-generated files but there may be some false positives.

Given the latest patch is removing the reference rather than switching to https, I think this could wait until the next release and the IE8 fallbacks can be removed from both the HTML and CSS.

I've removed the commit keyword and added needs-refresh to account for the CSS fallbacks too.

Note: See TracTickets for help on using tickets.