Membership Premium breaks after removing SSL certificate

Bit of a weird issue but our MU network recently removed it's SSL certificate and everything SSL was turned off. However, the membership module broke in the admin panel.

The membership module tries to load .js files, .css files and other resources over https and not https.

The offending line of code is in plugins/membership/membershipincludes/includes/functions.php
on line 147...

if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
		$M_membership_url = preg_replace('/http:/i', 'https:', $M_membership_url);
	}

If I comment out the preg_replace line of code, all is hunkydory and works fine.

Strange thing is, I have this plugin installed on a test network that has never had an SSL certificate (but is on the same server) and it works fine on the test network without having to comment out the code.

The server configuration is identical on both networks (because they're on the same server) but the live network that recently stopped using the SSL certificate doesn't work properly.

Interestingly, $_SERVER['HTTPS'] is empty on both sites and $_SERVER['SERVER_PORT'] is 80 on both sites.

Help?