Change is_file_valid_csv to wc_is_file_valid_csv

This pull request replaces the class-specific is_file_valid_csv() function with the global wc_is_file_valid_csv() function as requested by the todo that was previously above the is_file_valid_csv() function on the previous line 89.
This commit is contained in:
AlexTech01 2022-04-03 08:54:45 -05:00 committed by GitHub
parent feba6a8dcd
commit b903b84edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 12 deletions

View File

@ -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);
}
/**