Fix bug parsing memory_limit in product importer (#46051)
Previously, the code assumed that all memory_limit values used the "M" suffix (for megabytes); values using "G" (for gigabytes), "K" (for kilobytes), or no suffix (for bytes) were all parsed incorrectly. Now, all possible values should be handled correctly. This bug has actually been fixed twice before in other locations: Commit538403306c
(#30908) Commit4557108805
(#21557)
This commit is contained in:
parent
b5b96bed04
commit
0d368bfc53
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix bug parsing memory_limit in product importer
|
|
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue