Making WordPress.org

Changeset 11814


Ignore:
Timestamp:
05/04/2022 07:09:14 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Release Management: When displaying the shortcode, check if headers have been sent before attempting a redirect to avoid Warnings.

This only happens for logged in users who do not have any plugins.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-release-confirmation.php

    r11806 r11814  
    2525
    2626                if ( ! $plugins ) {
    27                         wp_safe_redirect( home_url( '/developers/' ) );
    28                         // Redirect via JS too, as technically the page output should've already started (but probably hasn't on WordPress.org)
     27                        if ( ! headers_sent() ) {
     28                                wp_safe_redirect( home_url( '/developers/' ) );
     29                        }
     30
     31                        // Redirect via JS too, as technically the page output should've already started.
    2932                        echo '<script>document.location=' . json_encode( home_url( '/developers/' ) ) . '</script>';
    3033                        exit;
Note: See TracChangeset for help on using the changeset viewer.