Ticket #13585: 13585.diff
File 13585.diff, 1.9 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/plugin.php
482 482 wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error 483 483 ob_start(); 484 484 include(WP_PLUGIN_DIR . '/' . $plugin); 485 if ( ob_get_length() > 0 ) {486 $output = ob_get_clean();487 return new WP_Error('unexpected_output', __('The plugin generated unexpected output.'), $output);488 }489 485 do_action( 'activate_plugin', trim( $plugin) ); 490 486 if ( $network_wide ) { 491 487 $current[$plugin] = time(); … … 497 493 } 498 494 do_action( 'activate_' . trim( $plugin ) ); 499 495 do_action( 'activated_plugin', trim( $plugin) ); 496 if ( ob_get_length() > 0 ) { 497 $output = ob_get_clean(); 498 return new WP_Error('unexpected_output', __('The plugin generated unexpected output.'), $output); 499 } 500 500 ob_end_clean(); 501 501 } 502 502 -
wp-admin/plugins.php
334 334 335 335 <?php if ( isset($_GET['error']) ) : 336 336 337 if ( isset($_GET['charsout']))338 $errmsg = sprintf(__(' Plugin could not be activated because it generated %d characters of <strong>unexpected output</strong>.'), $_GET['charsout']);337 if ( isset($_GET['charsout']) ) 338 $errmsg = sprintf(__('The plugin generated %d characters of <strong>unexpected output</strong> during activation. If “headers already sent” or other strange errors start occurring, try deactivating or removing this plugin.'), $_GET['charsout']); 339 339 else 340 340 $errmsg = __('Plugin could not be activated because it triggered a <strong>fatal error</strong>.'); 341 341