WordPress.org

Make WordPress Core

Ticket #44429: 44429-generic-cli.diff

File 44429-generic-cli.diff, 677 bytes (added by afragen, 17 months ago)

change test for generic test for CLI

  • src/wp-includes/pluggable.php

    diff --git src/wp-includes/pluggable.php src/wp-includes/pluggable.php
    index cb06297b57..1766cdc056 100644
    if ( ! function_exists( 'wp_redirect' ) ) : 
    12051205        function wp_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) {
    12061206                global $is_IIS;
    12071207
     1208                // Exit early when using WP-CLI.
     1209                $location_scheme = parse_url( $location, PHP_URL_SCHEME );
     1210                if ( 'cli' === php_sapi_name() && 'https' === $location_scheme ) {
     1211                        return;
     1212                }
     1213
    12081214                /**
    12091215                 * Filters the redirect location.
    12101216                 *
    if ( ! function_exists( 'wp_text_diff' ) ) : 
    27332739                return $r;
    27342740        }
    27352741endif;
    2736