WordPress.org

Make WordPress Core

Opened 9 months ago

Closed 3 months ago

Last modified 2 months ago

#46666 closed defect (bug) (fixed)

Allow charset to be passed to the wp_die function

Reported by: spacedmonkey Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version: 3.0
Component: Bootstrap/Load Keywords: good-first-bug has-patch has-dev-note
Focuses: Cc:
PR Number:

Description

Currently, all the wp_die handlers, use (by guessing) the utf-8 charset. However, this is not allow this isn't allows the correct charset that the site uses. This charset is store in an option on the site. In wp_die options can not be used, as wp_die can be called if a database connection fails. But where wp_die is called and there is a connection, charset could be passed as an arg.

Attachments (2)

46666.patch (3.0 KB) - added by mohsinrasool 9 months ago.
Newbie here. I developed attached solution by editing functions.php. I tried to follow WordPress coding standard as much as I am aware of. Please guide me if I made any mistakes. Trunk patch is attached.
46666.1.diff (1.6 KB) - added by socalchristina 9 months ago.
Add wp_die_handler

Download all attachments as: .zip

Change History (11)

@mohsinrasool
9 months ago

Newbie here. I developed attached solution by editing functions.php. I tried to follow WordPress coding standard as much as I am aware of. Please guide me if I made any mistakes. Trunk patch is attached.

#1 @socalchristina
9 months ago

Hi @spacedmonkey and @mohsinrasool. I'm a newbie just trying to learn my way around the contributions process. I like the changes you made @mohsinrasool. I wondered if charset needs a wp_die_handler to override the default handler for wp_die. @spacedmonkey, I'm not sure if this is what you meant by,

Currently, all the wp_die handlers, use (by guessing) the utf-8 charset.

@socalchristina
9 months ago

Add wp_die_handler

#2 @mohsinrasool
9 months ago

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

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


7 months ago

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


6 months ago

#5 @desrosj
6 months ago

  • Milestone changed from Awaiting Review to 5.3

#6 @SergeyBiryukov
6 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

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


4 months ago

#8 @SergeyBiryukov
3 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 46109:

Bootstrap/Load: Allow charset to be passed to the wp_die() function.

Props mohsinrasool, spacedmonkey, socalchristina.
Fixes #46666.

#9 @desrosj
2 months ago

  • Keywords has-dev-note added; 2nd-opinion removed

Mentioned in the Miscellaneous Developer Focused Changes dev note for 5.3: https://make.wordpress.org/core/2019/10/15/miscellaneous-developer-focused-changes-in-5-3/

Note: See TracTickets for help on using tickets.