Add filter for disabling file path check
This commit is contained in:
parent
acf8757636
commit
26b188569b
|
@ -91,7 +91,7 @@ class WC_Product_CSV_Importer_Controller {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function is_file_valid_csv( $file, $check_path = true ) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
|
||||||
$bootstrap = WC_Unit_Tests_Bootstrap::instance();
|
$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/import/class-wc-product-csv-importer.php';
|
||||||
require_once $bootstrap->plugin_dir . '/includes/admin/importers/class-wc-product-csv-importer-controller.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' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue