From 2d8cf34e499808960f291f2b91e5b90f9e1137d4 Mon Sep 17 00:00:00 2001 From: azaozz Date: Sat, 12 Dec 2009 09:20:07 +0000 Subject: [PATCH] Do not stop plugin activation due to E_DEPRECATED errors in php 5.3, props Denis-de-Bernardy, fixes #11250 git-svn-id: http://svn.automattic.com/wordpress/trunk@12383 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/plugins.php | 6 +++++- wp-admin/update.php | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 0f163b2ef6..48530eddce 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -93,7 +93,11 @@ if ( !empty($action) ) { if ( is_wp_error($valid) ) wp_die($valid); - error_reporting( E_ALL ^ E_NOTICE ); + if ( defined('E_RECOVERABLE_ERROR') ) + error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); + else + error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); + @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. include(WP_PLUGIN_DIR . '/' . $plugin); do_action('activate_' . $plugin); diff --git a/wp-admin/update.php b/wp-admin/update.php index f05de5dffa..304c81f8b9 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -52,7 +52,12 @@ if ( isset($_GET['action']) ) { if( isset($_GET['failure']) ){ echo '

' . __('Plugin failed to reactivate due to a fatal error.') . '

'; - error_reporting( E_ALL ^ E_NOTICE ); + + if ( defined('E_RECOVERABLE_ERROR') ) + error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); + else + error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); + @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. include(WP_PLUGIN_DIR . '/' . $plugin); }