summaryrefslogtreecommitdiff
path: root/modules/color
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-08-05 23:58:15 -0400
committerDavid Rothstein <drothstein@gmail.com>2013-08-05 23:58:15 -0400
commit19e65b966c79e7061827ef5f21ac67cd1159806c (patch)
treef5715889843ee7c991ff70083f31b2a55a0a2656 /modules/color
parentebe236b0c03750c624cd00db96fc535077e6f890 (diff)
downloadbrdo-19e65b966c79e7061827ef5f21ac67cd1159806c.tar.gz
brdo-19e65b966c79e7061827ef5f21ac67cd1159806c.tar.bz2
Issue #1453984 by xjm, naxoc, Dave Reid, underq, dags, tim.plunkett, Heine: Fixed Color module doesn't test for unlimited memory.
Diffstat (limited to 'modules/color')
-rw-r--r--modules/color/color.module7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/color/color.module b/modules/color/color.module
index 9ae7f73de..53c54fbf6 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -346,9 +346,10 @@ 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 <a href="@url">PHP documentation</a> for more information.', array('%size' => format_size($usage + $required - $limit), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error');
+ $memory_limit = ini_get('memory_limit');
+ $size = parse_size($memory_limit);
+ if (!drupal_check_memory_limit($usage + $required, $memory_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 <a href="@url">PHP documentation</a> for more information.', array('%size' => format_size($usage + $required - $size), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error');
return;
}
}