Code Duplication    Length = 11-11 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 1797-1807 (lines=11) @@
1794
		$posts          = array_unique( $wpdb->get_col( $query ) );
1795
		$found_products = array();
1796
1797
		if ( ! empty( $posts ) ) {
1798
			foreach ( $posts as $post ) {
1799
				$product = wc_get_product( $post );
1800
1801
				if ( ! current_user_can( 'read_product', $post ) ) {
1802
					continue;
1803
				}
1804
1805
				$found_products[ $post ] = rawurldecode( $product->get_formatted_name() );
1806
			}
1807
		}
1808
1809
		$found_products = apply_filters( 'woocommerce_json_search_found_products', $found_products );
1810
@@ 1866-1876 (lines=11) @@
1863
1864
				$posts = get_posts( $args );
1865
1866
				if ( ! empty( $posts ) ) {
1867
					foreach ( $posts as $post ) {
1868
						$product = wc_get_product( $post );
1869
1870
						if ( ! current_user_can( 'read_product', $post ) ) {
1871
							continue;
1872
						}
1873
1874
						$found_products[ $post ] = rawurldecode( $product->get_formatted_name() );
1875
					}
1876
				}
1877
			}
1878
		}
1879