Code Duplication    Length = 3-4 lines in 2 locations

modules/contact-form/grunion-contact-form.php 1 location

@@ 492-495 (lines=4) @@
489
			if ( in_array( $key, array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'HTTP_USER_AGENT', 'HTTP_REFERER' ) ) ) {
490
				// We don't care about cookies, and the UA and Referrer were caught above.
491
				continue;
492
			} elseif ( in_array( $key, array( 'REMOTE_ADDR', 'REQUEST_URI', 'DOCUMENT_URI' ) ) ) {
493
				// All three of these are relevant indicators and should be passed along.
494
				$form[ $key ] = $value;
495
			} elseif ( wp_startswith( $key, 'HTTP_' ) ) {
496
				// Any other HTTP header indicators.
497
				// `wp_startswith()` is a wpcom helper function and is included in Jetpack via `functions.compat.php`
498
				$form[ $key ] = $value;

modules/subscriptions.php 1 location

@@ 47-49 (lines=3) @@
44
45
		if ( 0 === strpos( $key, 'HTTP_' ) ) {
46
			$data[ $key ] = $value; // HTTP headers.
47
		} elseif ( in_array( $key, array( 'REMOTE_ADDR', 'REQUEST_URI', 'DOCUMENT_URI' ), true ) ) {
48
			$data[ $key ] = $value;
49
		}
50
	}
51
52
	return $data;