diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 99870f3..07b2fb4 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -3288,8 +3288,10 @@ function drupal_check_memory_limit($required, $memory_limit = NULL) { if (!isset($memory_limit)) { $memory_limit = ini_get('memory_limit'); } - if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size($required)) { - return FALSE; - } - return TRUE; + + // There is sufficient memory if: + // - No memory limit is set. + // - The memory limit is set to unlimited (-1). + // - The memory limit is greater than the memory required for the operation. + return ((!$memory_limit) || ($memory_limit == -1) || (parse_size($memory_limit) > parse_size($required))); }