Issue #2400287 by hass, cutesquirrel, borisson_, rteijeiro, aerozeppelin, yuriy.babenko, cyb.tachyon, pfrenssen, deanflory, webchick, David_Rothstein, cilefen, aspilicious, netbek, stefan.r, moshe weitzman, nod_, minakshiPh, pandaski: Remove all occurences of sourceMappingURL and sourceURL when JS files are aggregated
parent
16410c623a
commit
fbb5903edb
|
@ -5166,6 +5166,8 @@ function drupal_build_js_cache($files) {
|
|||
$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';
|
||||
|
|
Loading…
Reference in New Issue