Skip to content

Commit

Permalink
Using wp_safe_redirect when redirecting to/from https
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed May 31, 2019
1 parent e82f16f commit e6050df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/https.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ function pmpro_besecure()
if($besecure && (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off" || $_SERVER['HTTPS'] == "false"))
{
//need to be secure
wp_redirect("https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
wp_safe_redirect("https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit;
}
elseif(!$besecure && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off" && $_SERVER['HTTPS'] != "false")
{
//don't need to be secure
wp_redirect("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
wp_safe_redirect("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit;
}
}
Expand Down Expand Up @@ -139,7 +139,7 @@ function pmpro_admin_https_handler()
if(substr(get_option("siteurl"), 0, 5) == "http:" && !force_ssl_admin())
{
//need to redirect to non https
wp_redirect("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
wp_safe_redirect("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit;
}
}
Expand Down

0 comments on commit e6050df

Please sign in to comment.