? boost-598490.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.170
diff -u -p -r1.3.2.2.2.5.2.170 boost.module
--- boost.module	7 Oct 2009 19:41:10 -0000	1.3.2.2.2.5.2.170
+++ boost.module	7 Oct 2009 20:30:33 -0000
@@ -1281,14 +1281,46 @@ function boost_cache_expire($paths) {
     $data[$hash] = $info;
   }
 
+  // Expire all files that match up
+  boost_cache_expire_router($data);
+}
+
+/**
+ * Expires the static file cache for the given paths
+ *
+ * @param $router_items
+ *   Array of $router_item array "objects"
+ *     ['page_callback']
+ *     ['page_arguments']
+ *     ['page_id']
+ */
+function boost_cache_expire_router($router_items) {
   // Get filenames & hash from db
-  foreach ($data as $dblookup) {
-    $result = db_query("SELECT filename, hash FROM {boost_cache} WHERE page_callback = '%s' AND page_arguments = '%s' AND page_id = '%s'", $dblookup['page_callback'], $dblookup['page_arguments'], $dblookup['page_id']);
+  if (!is_array($router_items) {
+    return FALSE;
+  }
+  $count = 0;
+  foreach ($router_items as $dblookup) {
+    if (isset($dblookup['page_id'])) {
+      $result = db_query("SELECT filename, hash FROM {boost_cache} WHERE page_callback = '%s' AND page_arguments = '%s' AND page_id = '%s'", $dblookup['page_callback'], $dblookup['page_arguments'], $dblookup['page_id']);
+    }
+    elseif (isset($dblookup['page_arguments'])) {
+      $result = db_query("SELECT filename, hash FROM {boost_cache} WHERE page_callback = '%s' AND page_arguments = '%s'", $dblookup['page_callback'], $dblookup['page_arguments']);
+    }
+    elseif (isset($dblookup['page_callback'])) {
+      $result = db_query("SELECT filename, hash FROM {boost_cache} WHERE page_callback = '%s'", $dblookup['page_callback']);
+    }
+    else {
+      continue;
+    }
+
     while ($info = db_fetch_array($result)) {
       // Flush expired files
       boost_cache_kill($info['filename'], $info['hash']);
+      $count++;
     }
   }
+  return $count;
 }
 
 /**
