Code Duplication    Length = 5-8 lines in 3 locations

3rd-party/woocommerce-services.php 1 location

@@ 86-90 (lines=5) @@
83
				break;
84
		}
85
86
		if ( isset( $_GET['redirect'] ) ) {
87
			$redirect = home_url( esc_url_raw( wp_unslash( $_GET['redirect'] ) ) );
88
		} else {
89
			$redirect = admin_url();
90
		}
91
92
		if ( $result ) {
93
			$this->jetpack->stat( 'jitm', 'wooservices-activated-' . JETPACK__VERSION );

extensions/blocks/eventbrite/eventbrite.php 1 location

@@ 37-41 (lines=5) @@
34
 * @return string Current URL.
35
 */
36
function get_current_url() {
37
	if ( isset( $_SERVER['HTTP_HOST'] ) ) {
38
		$host = wp_unslash( $_SERVER['HTTP_HOST'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
39
	} else {
40
		$host = wp_parse_url( home_url(), PHP_URL_HOST );
41
	}
42
	if ( isset( $_SERVER['REQUEST_URI'] ) ) {
43
		$path = wp_unslash( $_SERVER['REQUEST_URI'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
44
	} else {

packages/status/src/class-status.php 1 location

@@ 238-245 (lines=8) @@
235
		 */
236
		$known_staging = apply_filters( 'jetpack_known_staging', $known_staging );
237
238
		if ( isset( $known_staging['urls'] ) ) {
239
			foreach ( $known_staging['urls'] as $url ) {
240
				if ( preg_match( $url, wp_parse_url( site_url(), PHP_URL_HOST ) ) ) {
241
					$is_staging = true;
242
					break;
243
				}
244
			}
245
		}
246
247
		if ( isset( $known_staging['constants'] ) ) {
248
			foreach ( $known_staging['constants'] as $constant ) {