summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-04-30 21:42:08 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-04-30 21:42:08 -0700
commit47f1ff523d738eb7d2e66ee7f689f62c5d6964de (patch)
tree547598c66b1be740f7c8827c89d19e81bf6b2143 /includes
parentb7ac66710151bfbb197e653c1d03a43d2ccfcbfa (diff)
downloadbrdo-47f1ff523d738eb7d2e66ee7f689f62c5d6964de.tar.gz
brdo-47f1ff523d738eb7d2e66ee7f689f62c5d6964de.tar.bz2
Issue #1404380 by msonnabaum, xjm, mjpa: Fixed Unnecessary aggregation of CSS/JS.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index ff2549317..f3c936e95 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3455,7 +3455,13 @@ function drupal_build_css_cache($css) {
$data = '';
$uri = '';
$map = variable_get('drupal_css_cache_files', array());
- $key = hash('sha256', serialize($css));
+ // Create a new array so that only the file names are used to create the hash.
+ // This prevents new aggregates from being created unnecessarily.
+ $css_data = array();
+ foreach ($css as $css_file) {
+ $css_data[] = $css_file['data'];
+ }
+ $key = hash('sha256', serialize($css_data));
if (isset($map[$key])) {
$uri = $map[$key];
}
@@ -4816,7 +4822,13 @@ function drupal_build_js_cache($files) {
$contents = '';
$uri = '';
$map = variable_get('drupal_js_cache_files', array());
- $key = hash('sha256', serialize($files));
+ // Create a new array so that only the file names are used to create the hash.
+ // This prevents new aggregates from being created unnecessarily.
+ $js_data = array();
+ foreach ($files as $file) {
+ $js_data[] = $file['data'];
+ }
+ $key = hash('sha256', serialize($js_data));
if (isset($map[$key])) {
$uri = $map[$key];
}