? js_agg_query_truncate.patch
Index: javascript_aggregator.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/javascript_aggregator/Attic/javascript_aggregator.module,v
retrieving revision 1.16.2.5
diff -u -p -r1.16.2.5 javascript_aggregator.module
--- javascript_aggregator.module	5 Dec 2008 07:47:25 -0000	1.16.2.5
+++ javascript_aggregator.module	2 Feb 2009 17:54:48 -0000
@@ -62,8 +62,17 @@ function javascript_aggregator_cache($sc
       foreach ($scripts_js_files as $scripts_js_file) {
         // Retreve the path without Drupal's base path.
         $scripts_js_file = substr($scripts_js_file, strlen(base_path()));
-        $data = file_get_contents($scripts_js_file);
-        $contents .= ";\n/* AGGREGATED JS FILE: $scripts_js_file */\n".$data."\n";
+        // Eliminate any query arguments or hash strings from the end of the name.
+        // These could happen because some smart modules try to help us version
+        // their Javascript files (get browsers reload them when we update the
+        // modules, even when the file name stays the same). Since Javascript
+        // aggregator users know they need to clear their JS cache on update,
+        // they will solve this issue manually.
+        $scripts_js_file = preg_replace('!(.+)([\?#].*)!', '\1', $scripts_js_file);
+        if (file_exists($scripts_js_file)) {
+          $data = file_get_contents($scripts_js_file);
+          $contents .= ";\n/* AGGREGATED JS FILE: $scripts_js_file */\n".$data."\n";
+        }
       }
 
       // JSMinify the JavaScript.
