Open SowmediaNL opened 7 years ago
This function in afg_libs.php fails on WPengine hosting and returns a url with port 80 set, but with https as protocol.
// Originele versie van de funktie // function afg_get_cur_url() { // $isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on"); // $port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443"))); // $port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : ''; // $url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$port.$_SERVER["REQUEST_URI"]; // return $url; // }
// changed function to always return with https, without setting a port. function afg_get_cur_url() { $isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on"); $port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443"))); $port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : ''; $url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$port.$_SERVER["REQUEST_URI"]; $url = 'https://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; return $url; }
This function in afg_libs.php fails on WPengine hosting and returns a url with port 80 set, but with https as protocol.
// Originele versie van de funktie // function afg_get_cur_url() { // $isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on"); // $port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443"))); // $port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : ''; // $url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$port.$_SERVER["REQUEST_URI"]; // return $url; // }
// changed function to always return with https, without setting a port. function afg_get_cur_url() { $isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on"); $port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443"))); $port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : ''; $url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$port.$_SERVER["REQUEST_URI"]; $url = 'https://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; return $url; }