diff --git a/plugins/woocommerce/includes/admin/importers/class-wc-product-csv-importer-controller.php b/plugins/woocommerce/includes/admin/importers/class-wc-product-csv-importer-controller.php index 848b36ad77b..97acf002e73 100644 --- a/plugins/woocommerce/includes/admin/importers/class-wc-product-csv-importer-controller.php +++ b/plugins/woocommerce/includes/admin/importers/class-wc-product-csv-importer-controller.php @@ -86,7 +86,6 @@ class WC_Product_CSV_Importer_Controller { /** * Check whether a file is a valid CSV file. * - * @todo Replace this method with wc_is_file_valid_csv() function. * @param string $file File path. * @param bool $check_path Whether to also check the file is located in a valid location (Default: true). * @return bool @@ -98,17 +97,7 @@ class WC_Product_CSV_Importer_Controller { * @param bool $check_import_file_path If the import file path should be checked. * @param string $file Path of the file to be checked. */ - if ( $check_path && apply_filters( 'woocommerce_product_csv_importer_check_import_file_path', true, $file ) && false !== stripos( $file, '://' ) ) { - return false; - } - - $valid_filetypes = self::get_valid_csv_filetypes(); - $filetype = wp_check_filetype( $file, $valid_filetypes ); - if ( in_array( $filetype['type'], $valid_filetypes, true ) ) { - return true; - } - - return false; + return wc_is_file_valid_csv($file, $check_path); } /**