Code Duplication    Length = 11-14 lines in 2 locations

src/wp-includes/load.php 1 location

@@ 967-980 (lines=14) @@
964
 *
965
 * @return bool True if SSL, otherwise false.
966
 */
967
function is_ssl() {
968
	if ( isset( $_SERVER['HTTPS'] ) ) {
969
		if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) {
970
			return true;
971
		}
972
973
		if ( '1' == $_SERVER['HTTPS'] ) {
974
			return true;
975
		}
976
	} elseif ( isset($_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
977
		return true;
978
	}
979
	return false;
980
}
981
982
/**
983
 * Converts a shorthand byte value to an integer byte value.

tests/phpunit/data/WPHTTP-testcase-redirection-script.php 1 location

@@ 4-14 (lines=11) @@
1
<?php
2
3
// Thanks WordPress..
4
function is_ssl() {
5
	if ( isset($_SERVER['HTTPS']) ) {
6
		if ( 'on' == strtolower($_SERVER['HTTPS']) )
7
			return true;
8
		if ( '1' == $_SERVER['HTTPS'] )
9
			return true;
10
	} elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
11
		return true;
12
	}
13
	return false;
14
}
15
16
$url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . (!empty($_SERVER['HTTP_POST']) && 80 != $_SERVER['HTTP_POST'] ? ':' . $_SERVER['HTTP_POST'] : '');
17
if ( strpos($_SERVER['REQUEST_URI'], '?') )