Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#46666 closed defect (bug) (fixed)

Allow charset to be passed to the wp_die function

Reported by: spacedmonkey's profile spacedmonkey Owned by: sergeybiryukov's profile 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:

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 6 years 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 6 years ago.
Add wp_die_handler

Download all attachments as: .zip

Change History (11)

@mohsinrasool
6 years 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
6 years 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
6 years ago

Add wp_die_handler

#2 @mohsinrasool
6 years ago

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

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


6 years ago

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


6 years ago

#5 @desrosj
6 years ago

  • Milestone changed from Awaiting Review to 5.3

#6 @SergeyBiryukov
6 years ago

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

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


5 years ago

#8 @SergeyBiryukov
5 years 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
5 years 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.