Code Duplication    Length = 11-11 lines in 2 locations

includes/class-wc-ajax.php 2 locations

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