Add filter for disabling file path check

This commit is contained in:
claudiulodro 2018-10-11 10:18:21 -07:00
parent acf8757636
commit 26b188569b
2 changed files with 3 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class WC_Product_CSV_Importer_Controller {
* @return bool
*/
public static function is_file_valid_csv( $file, $check_path = true ) {
if ( $check_path && 0 !== stripos( $file, ABSPATH ) ) {
if ( $check_path && apply_filters( 'woocommerce_product_csv_importer_check_import_file_path', true ) && 0 !== stripos( $file, ABSPATH ) ) {
return false;
}

View File

@ -27,6 +27,8 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
$bootstrap = WC_Unit_Tests_Bootstrap::instance();
require_once $bootstrap->plugin_dir . '/includes/import/class-wc-product-csv-importer.php';
require_once $bootstrap->plugin_dir . '/includes/admin/importers/class-wc-product-csv-importer-controller.php';
add_filter( 'woocommerce_product_csv_importer_check_import_file_path', '__return_false' );
}
/**