Skip to content
Snippets Groups Projects
Commit 6cc59e52 authored by Angie Byron's avatar Angie Byron
Browse files

#452704 by andypost: Prefix aggregated CSS and JS files to prevent certain...

#452704 by andypost: Prefix aggregated CSS and JS files to prevent certain firewalls from blocking them if by random coincidence they start with ad*.
parent e8c67464
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -2139,7 +2139,9 @@ function drupal_get_css($css = NULL) {
}
if ($is_writable && $preprocess_css) {
$filename = md5(serialize($types) . $query_string) . '.css';
// Prefix filename to prevent blocking by firewalls which reject files
// starting with "ad*".
$filename = 'css_' . md5(serialize($types) . $query_string) . '.css';
$preprocess_file = drupal_build_css_cache($types, $filename);
$output .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $preprocess_file . '" />' . "\n";
}
......@@ -2605,7 +2607,9 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
// Aggregate any remaining JS files that haven't already been output.
if ($is_writable && $preprocess_js && count($files) > 0) {
$filename = md5(serialize($files) . $query_string) . '.js';
// Prefix filename to prevent blocking by firewalls which reject files
// starting with "ad*".
$filename = 'js_' . md5(serialize($files) . $query_string) . '.js';
$preprocess_file = drupal_build_js_cache($files, $filename);
$preprocessed .= '<script type="text/javascript" src="' . base_path() . $preprocess_file . '"></script>' . "\n";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment