Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#45850 closed defect (bug) (invalid)

wp_specialchars_decode not working in 5.0 or later

Reported by: kailanitish90's profile kailanitish90 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:

Description

The wp_specialchars_decode not working when we get the content from the DB and put it to the csv file.

Step to generate:

  1. add new page page.
  2. Enter the title with "'"(apostrophe) like "Bachelor's Degree's"
  3. Get the post title on coding side and put into the CSV file.
  4. The "'"(apostrophe) will be display as a html code(’).

Change History (5)

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


4 years ago

This ticket was mentioned in Slack in #core-committers by kailanitish90. View the logs.


4 years ago

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


4 years ago

This ticket was mentioned in Slack in #core-comments by kailanitish90. View the logs.


4 years ago

#5 @SergeyBiryukov
4 years ago

  • Component changed from General to Formatting
  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Thanks for the ticket, sorry it took so long for someone to get back to you.

In my testing, wp_specialchars_decode() has never worked with &#8217, neither before nor after 5.0.

As a mirror function to _wp_specialchars(), it deals with a limited set of characters, including &, <, >, ", and '.

It's not supposed to deal with curly quotes like &#8217 (right single quotation mark).

I don't see a bug here. If you need a function to convert &#8217 to the actual character, then html_entity_decode() should do that.

Note: See TracTickets for help on using tickets.