### Eclipse Workspace Patch 1.0
#P drupal6
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.756.2.106
diff -u -r1.756.2.106 common.inc
--- includes/common.inc 15 Dec 2010 21:11:22 -0000 1.756.2.106
+++ includes/common.inc 7 Feb 2011 15:44:01 -0000
@@ -1848,7 +1848,7 @@
$preprocess_css = (variable_get('preprocess_css', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
$directory = file_directory_path();
- $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+ $is_writable = is_dir($directory) && is_writable($directory);
// A dummy query-string is added to filenames, to gain control over
// browser-caching. The string changes on every update or full cache
@@ -1901,7 +1901,7 @@
// starting with "ad*".
$filename = 'css_'. md5(serialize($types) . $query_string) .'.css';
$preprocess_file = drupal_build_css_cache($types, $filename);
- $output .= ''."\n";
+ $output .= ''. "\n";
}
}
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.63.2.16
diff -u -r1.63.2.16 system.admin.inc
--- modules/system/system.admin.inc 6 Sep 2010 10:49:14 -0000 1.63.2.16
+++ modules/system/system.admin.inc 7 Feb 2011 15:44:01 -0000
@@ -1344,7 +1344,7 @@
);
$directory = file_directory_path();
- $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+ $is_writable = is_dir($directory) && is_writable($directory);
$form['bandwidth_optimizations']['preprocess_css'] = array(
'#type' => 'radios',
'#title' => t('Optimize CSS files'),
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.585.2.59
diff -u -r1.585.2.59 system.module
--- modules/system/system.module 15 Dec 2010 21:11:23 -0000 1.585.2.59
+++ modules/system/system.module 7 Feb 2011 15:44:02 -0000
@@ -1940,3 +1940,13 @@
$image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system'));
return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE));
}
+
+/**
+ * Implementation of hook_file_download().
+ * Make sure css aggregation folder is always accessible when using private file downloads.
+ */
+function system_file_download($file) {
+ if (strpos($file, 'css/') === 0) {
+ return array('Content-type: text/css');
+ }
+}