mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG Change Requirements::include_in_response() to not add empty
'X-Include-JS' or 'X-Include-CSS' headers.
This commit is contained in:
parent
e67db6d95a
commit
b6627a2f7c
@ -1148,8 +1148,10 @@ class Requirements_Backend
|
|||||||
$jsRequirements[] = str_replace(',', '%2C', $path);
|
$jsRequirements[] = str_replace(',', '%2C', $path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$response->addHeader('X-Include-JS', implode(',', $jsRequirements));
|
if(count($jsRequirements)) {
|
||||||
|
$response->addHeader('X-Include-JS', implode(',', $jsRequirements));
|
||||||
|
}
|
||||||
|
|
||||||
foreach($this->getCSS() as $file => $params) {
|
foreach($this->getCSS() as $file => $params) {
|
||||||
$path = $this->pathForFile($file);
|
$path = $this->pathForFile($file);
|
||||||
@ -1159,7 +1161,9 @@ class Requirements_Backend
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$response->addHeader('X-Include-CSS', implode(',', $cssRequirements));
|
if(count($cssRequirements)) {
|
||||||
|
$response->addHeader('X-Include-CSS', implode(',', $cssRequirements));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1655,4 +1659,4 @@ interface Requirements_Minifier {
|
|||||||
* @return string minified content
|
* @return string minified content
|
||||||
*/
|
*/
|
||||||
public function minify($content, $type, $filename);
|
public function minify($content, $type, $filename);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user