Code Duplication    Length = 10-11 lines in 2 locations

functions.php 2 locations

@@ 58-67 (lines=10) @@
55
 */
56
function isHttps()
57
{
58
	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
59
		if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
60
			// Client <=> Proxy is encrypted
61
			return true;
62
		}
63
		else {
64
			// Proxy <=> Server link is encrypted, but not Client <=> Proxy.
65
			return false;
66
		}
67
	}
68
69
	if (isset($_SERVER['HTTPS'])) {
70
		if ($_SERVER['HTTPS'] === 'off') {
@@ 69-79 (lines=11) @@
66
		}
67
	}
68
69
	if (isset($_SERVER['HTTPS'])) {
70
		if ($_SERVER['HTTPS'] === 'off') {
71
			// ISAPI on IIS breaks the spec. :(
72
			return false;
73
		}
74
75
		if ($_SERVER['HTTPS'] !== '') {
76
			// Set to a non-empty value
77
			return true;
78
		}
79
	}
80
81
	return false;
82
}