diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 4a61b62..d7689ff 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -324,10 +324,12 @@ function color_scheme_form_submit($form, &$form_state) { // memory_get_usage(), therefore we won't inadvertently reject a color // scheme change based on a faulty memory calculation. $usage = memory_get_usage(TRUE); - $limit = parse_size(ini_get('memory_limit')); - if ($usage + $required > $limit) { - drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the PHP documentation for more information.', array('%size' => format_size($usage + $required - $limit), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error'); - return; + $limit = ini_get('memory_limit'); + if ($limit != -1) { + if ($usage + $required > parse_size($limit)) { + drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the PHP documentation for more information.', array('%size' => format_size($usage + $required - $limit), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error'); + return; + } } }