Skip to content

Commit a28c4e5

Browse files
committed
Fix is_ssl() when using forward
1 parent 95694a7 commit a28c4e5

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

includes/class-wc-dev-helper-use-forwarded-urls.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ public function __construct() {
100100

101101
// prevent redirection
102102
add_filter( 'redirect_canonical', '__return_false' );
103+
104+
// if accessing via SSL, let WP know (see notes under https://codex.wordpress.org/Function_Reference/is_ssl)
105+
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
106+
$_SERVER['HTTPS'] = 'on';
107+
}
103108
}
104109

105110

includes/wc-dev-helper-functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function wp_var_dump( $var, $return = true, $html_errors = false ) {
114114
* @since 0.1.0
115115
* @param mixed $var variable to log
116116
* @param bool $dump use wp_var_dump() instead of print_r(), default false
117+
* @return string
117118
*/
118119
function wp_var_log( $var, $dump = false ) {
119120

woocommerce-dev-helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct() {
5858

5959

6060
/**
61-
* Removes the "Please install Woo Updater" notice when an offical WC extension
61+
* Removes the "Please install Woo Updater" notice when an official WC extension
6262
* is active but the Woo Updater plugin is not
6363
*
6464
* @since 0.1.0

0 commit comments

Comments
 (0)