? .directory
? drupal-755586-D7.patch
? drupal-828268-D7.patch
? includes/.directory
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1176
diff -u -p -r1.1176 common.inc
--- includes/common.inc	9 Jun 2010 14:55:30 -0000	1.1176
+++ includes/common.inc	15 Jun 2010 17:39:20 -0000
@@ -2099,7 +2099,7 @@ function url($path = NULL, array $option
  * @param $path
  *   The internal path or external URL being linked to, such as "node/34" or
  *   "http://example.com/foo".
- * @return 
+ * @return
  *   Boolean TRUE or FALSE, where TRUE indicates an external path.
  */
 function url_is_external($path) {
@@ -3143,7 +3143,17 @@ function drupal_build_css_cache($css) {
     $uri = $map[$key];
   }
 
-  if (empty($uri) || !file_exists($uri)) {
+  $build = FALSE;
+  if (file_exists($uri)) {
+    if (@filesize($uri) == 0) {
+      $build = TRUE;
+    }
+  }
+  elseif (empty($uri) || !file_exists($uri)) {
+    $build = TRUE;
+  }
+
+  if ($build) {
     // Build aggregate CSS file.
     foreach ($css as $stylesheet) {
       // Only 'file' stylesheets can be aggregated.
@@ -3175,6 +3185,10 @@ function drupal_build_css_cache($css) {
     if (!file_exists($uri) && !file_unmanaged_save_data($data, $uri, FILE_EXISTS_REPLACE)) {
       return FALSE;
     }
+    // Make sure filesize is not zero
+    if (@filesize($uri) == 0) {
+      return FALSE;
+    }
     // Save the updated map.
     $map[$key] = $uri;
     variable_set('drupal_css_cache_files', $map);
@@ -4328,7 +4342,17 @@ function drupal_build_js_cache($files) {
     $uri = $map[$key];
   }
 
-  if (empty($uri) || !file_exists($uri)) {
+  $build = FALSE;
+  if (file_exists($uri)) {
+    if (@filesize($uri) == 0) {
+      $build = TRUE;
+    }
+  }
+  elseif (empty($uri) || !file_exists($uri)) {
+    $build = TRUE;
+  }
+
+  if ($build) {
     // Build aggregate JS file.
     foreach ($files as $path => $info) {
       if ($info['preprocess']) {
@@ -4347,6 +4371,10 @@ function drupal_build_js_cache($files) {
     if (!file_unmanaged_save_data($contents, $uri, FILE_EXISTS_REPLACE)) {
       return FALSE;
     }
+    // Make sure filesize is not zero
+    if (@filesize($uri) == 0) {
+      return FALSE;
+    }
     $map[$key] = $uri;
     variable_set('drupal_js_cache_files', $map);
   }
