From 3685cf3fd7ac9ea3a97f3964293bb7bee8f59475 Wed, 31 Dec 2014 03:16:53 +0100
From: hass <hass@85918.no-reply.drupal.org>
Date: Wed, 31 Dec 2014 03:16:33 +0100
Subject: [PATCH] Issue #2400287 by hass: Remove JS source and source mapping urls or these may cause 404 errors.

diff --git a/includes/common.inc b/includes/common.inc
index 20cc82b..14a8871 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -4986,6 +4986,8 @@
         $contents .= file_get_contents($path) . ";\n";
       }
     }
+    // Remove JS source and source mapping urls or these may cause 404 errors.
+    $contents = preg_replace('/\/\/(#|@)\s(sourceURL|sourceMappingURL)=\s*(\S*?)\s*$/m', '', $contents);
     // Prefix filename to prevent blocking by firewalls which reject files
     // starting with "ad*".
     $filename = 'js_' . drupal_hash_base64($contents) . '.js';