ronakg / awesome-flickr-gallery-plugin

Create a photo gallery of your Flickr photos on your WordPress enabled website enabling you to customize it the way you like it. This project was originally hosted at http://wordpress.org/plugins/awesome-flickr-gallery-plugin/
18 stars 20 forks source link

Protocol check fails on WPengine #144

Open SowmediaNL opened 7 years ago

SowmediaNL commented 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; }