Ticket #2902 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

WP_Die function for display errors

Reported by: Sewar Assigned to: Sewar
Priority: normal Milestone: 2.1
Component: Administration Version: 2.0.3
Severity: normal Keywords: i18n error UTF-8 charset bg|has-patch bg|needs-testing
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

wp_die.diff (2.2 kB) - added by Sewar on 07/05/06 00:12:11.
WP_Die function
wp_die.2.diff (7.1 kB) - added by Sewar on 07/08/06 23:25:26.
wp_die.3.diff (10.2 kB) - added by Sewar on 07/09/06 22:36:42.
Fix some bugs.

Change History

07/05/06 00:12:11 changed by Sewar

  • attachment wp_die.diff added.

WP_Die function

07/05/06 00:17:49 changed by Sewar

  • owner changed from anonymous to Sewar.

07/05/06 19:13:29 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

07/08/06 23:25:26 changed by Sewar

  • attachment wp_die.2.diff added.

07/08/06 23:28:42 changed by Sewar

  • status changed from closed to reopened.
  • resolution deleted.

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?

07/09/06 22:36:42 changed by Sewar

  • attachment wp_die.3.diff added.

Fix some bugs.

07/10/06 05:28:41 changed by ryan

  • milestone changed from 2.0.4 to 2.1.

07/10/06 05:29:13 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

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