Code Duplication    Length = 10-10 lines in 2 locations

src/wp-includes/class-http.php 1 location

@@ 736-745 (lines=10) @@
733
734
		static $accessible_hosts = null;
735
		static $wildcard_regex = array();
736
		if ( null === $accessible_hosts ) {
737
			$accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS);
738
739
			if ( false !== strpos(WP_ACCESSIBLE_HOSTS, '*') ) {
740
				$wildcard_regex = array();
741
				foreach ( $accessible_hosts as $host )
742
					$wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
743
				$wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
744
			}
745
		}
746
747
		if ( !empty($wildcard_regex) )
748
			return !preg_match($wildcard_regex, $check['host']);

src/wp-includes/class-wp-http-proxy.php 1 location

@@ 203-212 (lines=10) @@
200
201
		static $bypass_hosts = null;
202
		static $wildcard_regex = array();
203
		if ( null === $bypass_hosts ) {
204
			$bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
205
206
			if ( false !== strpos(WP_PROXY_BYPASS_HOSTS, '*') ) {
207
				$wildcard_regex = array();
208
				foreach ( $bypass_hosts as $host )
209
					$wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
210
				$wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
211
			}
212
		}
213
214
		if ( !empty($wildcard_regex) )
215
			return !preg_match($wildcard_regex, $check['host']);