diff --git a/plugins/woocommerce/changelog/do-not-assume-megabytes b/plugins/woocommerce/changelog/do-not-assume-megabytes new file mode 100644 index 00000000000..f3c847a5c13 --- /dev/null +++ b/plugins/woocommerce/changelog/do-not-assume-megabytes @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix bug parsing memory_limit in product importer diff --git a/plugins/woocommerce/includes/import/abstract-wc-product-importer.php b/plugins/woocommerce/includes/import/abstract-wc-product-importer.php index f2fc33bc29f..44c8db04c9e 100644 --- a/plugins/woocommerce/includes/import/abstract-wc-product-importer.php +++ b/plugins/woocommerce/includes/import/abstract-wc-product-importer.php @@ -747,7 +747,7 @@ abstract class WC_Product_Importer implements WC_Importer_Interface { // Unlimited, set to 32GB. $memory_limit = '32000M'; } - return intval( $memory_limit ) * 1024 * 1024; + return wp_convert_hr_to_bytes( $memory_limit ); } /**