WordPress.org

Make WordPress Core

Ticket #44429: 44429-generic-cli-no-scheme.diff

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

uses php_sapi_name() and no check for HTTP scheme

  • src/wp-includes/pluggable.php

    diff --git src/wp-includes/pluggable.php src/wp-includes/pluggable.php
    index cb06297b57..488f50703b 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                if ( 'cli' === php_sapi_name() ) {
     1210                        return;
     1211                }
     1212
    12081213                /**
    12091214                 * Filters the redirect location.
    12101215                 *
    if ( ! function_exists( 'wp_text_diff' ) ) : 
    27332738                return $r;
    27342739        }
    27352740endif;
    2736