Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#2902 closed defect (bug) (fixed)

WP_Die function for display errors

Reported by: sewar's profile Sewar Owned by: sewar's profile Sewar
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.0.3
Component: Administration Keywords: i18n error UTF-8 charset bg|has-patch bg|needs-testing
Focuses: Cc:

Description

If there are error breaks WP, like upgrade files without update DB, WP will use "die" function to display the localized error message, but this will display the message without selecting charset, so browsers will try to guess the right charset but they will filed, FireFox for example will display Arabic messages using Cyrillic charset!

WP_Die function display errors in nice page and set charset to UTF-8 in both HTTP and HTML headers, it's modify copy of "bail" function in wp-db.php which display DB errors.

To test the patch apply it and change $wp_db_version then go to admin.

Attachments (3)

wp_die.diff (2.2 KB) - added by Sewar 18 years ago.
WP_Die function
wp_die.2.diff (7.1 KB) - added by Sewar 18 years ago.
wp_die.3.diff (10.2 KB) - added by Sewar 18 years ago.
Fix some bugs.

Download all attachments as: .zip

Change History (8)

@Sewar
18 years ago

WP_Die function

#1 @Sewar
18 years ago

  • Owner changed from anonymous to Sewar

#2 @ryan
18 years ago

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

(In [3979]) Die with style. Props Sewar. fixes #2902

@Sewar
18 years ago

#3 @Sewar
18 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

In the last patch remove "$wpdb->show_errors" because it's for DB only. Put HTML code directly outside PHP code, this allow us using functions and "defines" and any PHP code, unfortunately, it means remove "wp_die" filter.

Are you have any solutions?

@Sewar
18 years ago

Fix some bugs.

#4 @ryan
18 years ago

  • Milestone changed from 2.0.4 to 2.1

#5 @ryan
18 years ago

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

(In [4006]) wp_die() improvements from Sewar. fixes #2902

Note: See TracTickets for help on using tickets.