Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 1530-1534 (lines=5) @@
1527
			wp_die();
1528
		}
1529
1530
		if ( ! empty( $_GET['limit'] ) ) {
1531
			$limit = absint( $_GET['limit'] );
1532
		} else {
1533
			$limit = absint( apply_filters( 'woocommerce_json_search_limit', 30 ) );
1534
		}
1535
1536
		$include_ids = ! empty( $_GET['include'] ) ? array_map( 'absint', (array) wp_unslash( $_GET['include'] ) ) : array();
1537
		$exclude_ids = ! empty( $_GET['exclude'] ) ? array_map( 'absint', (array) wp_unslash( $_GET['exclude'] ) ) : array();
@@ 1578-1582 (lines=5) @@
1575
	public static function json_search_downloadable_products_and_variations() {
1576
		check_ajax_referer( 'search-products', 'security' );
1577
1578
		if ( ! empty( $_GET['limit'] ) ) {
1579
			$limit = absint( $_GET['limit'] );
1580
		} else {
1581
			$limit = absint( apply_filters( 'woocommerce_json_search_limit', 30 ) );
1582
		}
1583
1584
		$include_ids = ! empty( $_GET['include'] ) ? array_map( 'absint', (array) wp_unslash( $_GET['include'] ) ) : array();
1585
		$exclude_ids = ! empty( $_GET['exclude'] ) ? array_map( 'absint', (array) wp_unslash( $_GET['exclude'] ) ) : array();