WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 5 weeks ago

#26536 closed defect (bug) (fixed)

wp_check_php_mysql_versions() outputs messages with no charset defined

Reported by: rodrigosprimo Owned by: nacin
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.4.2
Component: Upgrade/Install Keywords: has-patch 3.9-early
Focuses: Cc:

Description

After [21715] the function wp_check_php_mysql_versions() doesn't define a charset before sending messages to the browser leading to strings with invalid characters in some languages. For example, in Brazilian Portuguese, if the MySQL extension for PHP is not installed the user sees the string below:

Parece que em sua instalação do PHP está faltando a extensão MySQL, que é requesitada pelo WordPress.

I'm not sure if we should simply set the charset calling the header() function (patch attached) or if we should move wp_die() function to another or a new file where it can be used by wp_check_php_mysql_versions() as Nacin proposed in comment:6:ticket:21316. I don't know WP enough to decide where could be a better location for wp_die().

Attachments (1)

26536.patch (927 bytes) - added by rodrigosprimo 4 months ago.
Add ! hearders_sent() check

Download all attachments as: .zip

Change History (5)

comment:1 follow-up: SergeyBiryukov4 months ago

  • Keywords has-patch 3.9-early added
  • Milestone changed from Awaiting Review to Future Release
  • Version set to 3.4.2

I'm not sure if we should simply set the charset calling the header() function (patch attached)

That's what _default_wp_die_handler() does, so 26536.patch looks good to me.

Should probably add a ! headers_sent() check just in case.

rodrigosprimo4 months ago

Add ! hearders_sent() check

comment:2 in reply to: ↑ 1 rodrigosprimo4 months ago

Should probably add a ! headers_sent() check just in case.

Done, thanks for your feedback.

comment:3 SergeyBiryukov4 months ago

  • Milestone changed from Future Release to 3.9

comment:4 nacin5 weeks ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 27557:

Send a charset header when erroring out in wp_check_php_mysql_versions().

props rodrigosprimo.
fixes #26536.

Note: See TracTickets for help on using tickets.