WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 3 years ago

Last modified 3 years ago

#9030 closed enhancement (wontfix)

Named entities present in WP core

Reported by: sampablokuper Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Validation Keywords: has-patch needs-testing gsoc
Focuses: Cc:

Description

The entity ' ' is referenced in wp-includes/comment-template.php . While this is fine for most doctypes, it is not universally trouble-free.

I propose that instances of ' ' in this file be replaced with ' ' and that if there are any other named character references in WP core files, then those should also be replaced with their numeric equivalents.

With luck, this will be a painless fix :)

Attachments (3)

9030.diff (32.9 KB) - added by Denis-de-Bernardy 6 years ago.
9030.2.diff (40.9 KB) - added by wojtek.szkutnik 5 years ago.
entityrep.diff (127.0 KB) - added by Chase-san 3 years ago.
Replaces almost all named entities by their numeric counterparts (hand checked).

Download all attachments as: .zip

Change History (21)

comment:1 follow-up: @westi6 years ago

  • Keywords reporter-feedback added
  • Milestone changed from 2.8 to 2.9

That link reads to me like the issue is not the fact that named entities are used but that the rendering engine (browser) you are using does not know about the DTD you are using and so falls back to plain vanila xml.

Surely a named entity like   is valid for the RDFa in XHTML spec and so in that context the document is valid?

comment:2 in reply to: ↑ 1 @sampablokuper6 years ago

Replying to westi:

That link reads to me like the issue is not the fact that named entities are used but that the rendering engine (browser) you are using does not know about the DTD you are using and so falls back to plain vanila xml.

That does seem to be what's happening, but since it happens in WebKit and Gecko-based browsers, the userbase potentially affected is large.

Surely a named entity like   is valid for the RDFa in XHTML spec and so in that context the document is valid?

Perhaps, but it still causes problems. OTOH, getting rid of named entities other than the 5 predefined XML entities in WP core is a very small task and easy to maintain by using NCRs or their corresponding UTF-8 characters instead.

Another reason in favour of this is that people who want to use WordPress to serve XHTML with XSDs instead of DTDs will benefit too.

@Denis-de-Bernardy6 years ago

comment:3 follow-up: @Denis-de-Bernardy6 years ago

  • Keywords has-patch needs-testing 2nd-opinion added; reporter-feedback removed

patch leaves the following untouched:

  • javascript libraries
  • charmaps

it changes them everywhere else

comment:4 in reply to: ↑ 3 @sampablokuper6 years ago

Replying to Denis-de-Bernardy:

patch leaves the following untouched:

  • javascript libraries
  • charmaps

it changes them everywhere else

Thanks for doing this. I haven't tested it, just had a quick look at the diff. I notice that in addition to replacing the named entities, you've made a few other changes, e.g. to wp-admin/edit-link-form.php and wp-admin/edit-page-form.php . Are these related? Sorry if I'm being dense!

Thanks,

Sam

comment:5 @Denis-de-Bernardy6 years ago

not at all, but it was faster to do them all at once with a mass find/replace selected.

comment:6 @Denis-de-Bernardy6 years ago

  • Keywords needs-patch added; has-patch needs-testing 2nd-opinion removed

patch is broken

comment:7 @sampablokuper6 years ago

Might be best to stick to one patch per ticket.

In what way is it broken?

comment:8 @Denis-de-Bernardy6 years ago

it's loaded with Hunk #X FAILED at YYY... needs to be redone.

comment:9 @Denis-de-Bernardy6 years ago

  • Milestone changed from 2.9 to Future Release
  • Type changed from defect (bug) to enhancement

comment:10 @wojtek.szkutnik5 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords has-patch needs-testing added; needs-patch removed

Redone.

comment:11 @wojtek.szkutnik5 years ago

  • Keywords gsoc added

@wojtek.szkutnik5 years ago

comment:12 @GaryJ4 years ago

  • Cc GaryJ added

@Chase-san3 years ago

Replaces almost all named entities by their numeric counterparts (hand checked).

comment:13 @Chase-san3 years ago

I made a patch of this (and most other entities) using trunk-21080. I attached it here.

comment:15 @Chase-san3 years ago

  • Version changed from 2.7 to 3.4

comment:16 @SergeyBiryukov3 years ago

  • Version changed from 3.4 to 2.7

Version field indicates when the enhancement was initially suggested.

comment:17 follow-up: @SergeyBiryukov3 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

#8714 suggests an opposite change (to standardize on …).

Getting rid of named entities in core doesn't sound like something we want to do. Even though there's a somewhat recent patch, the ticket had no other traction for two years. I guess it's safe to close it along with #13341.

Last edited 3 years ago by SergeyBiryukov (previous) (diff)

comment:18 in reply to: ↑ 17 @Chase-san3 years ago

I can deal with that. But I would like to see #13341 fixed sometime soon. I was having issues with that earlier.

Note: See TracTickets for help on using tickets.