WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/28/2010 12:18:00 AM (12 years ago)
Author:
ryan
Message:

Allow plugin activation even if plugin generates extra output. Make warning more informative. fixes #13585

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r14546 r15017  
    483483        ob_start();
    484484        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         }
    489485        do_action( 'activate_plugin', trim( $plugin) );
    490486        if ( $network_wide ) {
     
    498494        do_action( 'activate_' . trim( $plugin ) );
    499495        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        }
    500500        ob_end_clean();
    501501    }
Note: See TracChangeset for help on using the changeset viewer.