Skip to content

Commit

Permalink
Removed WooCommerce::fix_server_vars, closes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosanches committed Jul 6, 2015
1 parent 1597016 commit ca27b01
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ public function setup_environment() {

$this->add_thumbnail_support();
$this->add_image_sizes();
$this->fix_server_vars();
}

/**
Expand Down Expand Up @@ -372,28 +371,6 @@ private function add_image_sizes() {
add_image_size( 'shop_single', $shop_single['width'], $shop_single['height'], $shop_single['crop'] );
}

/**
* Fix `$_SERVER` variables for various setups.
*
* Note: Removed IIS handling due to wp_fix_server_vars()
*
* @since 2.3
*/
private function fix_server_vars() {
// NGINX Proxy
if ( ! isset( $_SERVER['REMOTE_ADDR'] ) && isset( $_SERVER['HTTP_REMOTE_ADDR'] ) ) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_REMOTE_ADDR'];
}

if ( ! isset( $_SERVER['HTTPS'] ) ) {
if ( ! empty( $_SERVER['HTTP_HTTPS'] ) ) {
$_SERVER['HTTPS'] = $_SERVER['HTTP_HTTPS'];
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {
$_SERVER['HTTPS'] = '1';
}
}
}

/**
* Get the plugin url.
* @return string
Expand Down

0 comments on commit ca27b01

Please sign in to comment.