? license-1.patch
Index: javascript_aggregator.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/javascript_aggregator/Attic/javascript_aggregator.module,v
retrieving revision 1.17.2.14
diff -u -9 -p -r1.17.2.14 javascript_aggregator.module
--- javascript_aggregator.module	22 Jul 2009 21:42:44 -0000	1.17.2.14
+++ javascript_aggregator.module	12 Apr 2010 14:15:41 -0000
@@ -106,18 +106,24 @@ function _javascript_aggregator_minify($
           require_once(drupal_get_path('module', 'javascript_aggregator') .'/jsminplus.php');
           $contents = JSMinPlus::minify(file_get_contents(file_directory_path() . $aggregated_file_name));
         }
         else {
           // JSMin the contents of the aggregated file.
           require_once(drupal_get_path('module', 'javascript_aggregator') .'/jsmin.php');
           $contents = JSMin::minify(file_get_contents(file_directory_path() . $aggregated_file_name));
         }
 
+        // Code comments containing copyright notices and licensing information
+        // are stripped when the file is minified. GPL and most other open
+        // source licenses require the license text to be included whenever the
+        // file is distributed, so include a reference to the un-minified file.
+        $contents = 'Minified using Javascript Aggregator - see '. $path_to_files_directory . $aggregated_file_name ." for original source including licensing information.\n". $contents;
+
         // GZip the JavaScript if required.
         $htaccess = file_directory_path() . '/js/.htaccess';
         if (variable_get('javascript_aggregator_gzip', FALSE)) {
 
           // Create the GZip file if it doesn't already exist.
           if (!file_exists($jsmin_file_name .'.gz')) {
             file_save_data(gzencode($contents, 9), $jsmin_file_name .'.gz', FILE_EXISTS_REPLACE);
           }
 
