Merge pull request #57133 from nextcloud/fix-template-headers-injection

fix(lib): include headers from OC\Template\Template as well in produced HTML
This commit is contained in:
Côme Chilliet 2025-12-18 11:59:09 +01:00 committed by GitHub
commit 9b1227749f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,7 +122,7 @@ class Template extends Base implements ITemplate {
// Add custom headers
$headers = '';
foreach (\OC_Util::$headers as $header) {
foreach (array_merge(\OC_Util::$headers, $this->headers) as $header) {
$headers .= '<' . Util::sanitizeHTML($header['tag']);
if (strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes'])))) {
$headers .= ' defer';