summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/template.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/template.php')
-rw-r--r--lib/private/legacy/template.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php
index b4c69327438..4f7c11d0b64 100644
--- a/lib/private/legacy/template.php
+++ b/lib/private/legacy/template.php
@@ -12,6 +12,7 @@
* @author Joas Schilling <coding@schilljs.com>
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
* @author Lukas Reschke <lukas@statuscode.ch>
+ * @author Michael Letzgus <develope@michael-letzgus.de>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Raghu Nayyar <hey@raghunayyar.com>
* @author Robin Appelman <robin@icewind.nl>
@@ -208,6 +209,9 @@ class OC_Template extends \OC\Template\Base {
$headers = '';
foreach(OC_Util::$headers as $header) {
$headers .= '<'.\OCP\Util::sanitizeHTML($header['tag']);
+ if ( strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes']))) ) {
+ $headers .= ' defer';
+ }
foreach($header['attributes'] as $name=>$value) {
$headers .= ' '.\OCP\Util::sanitizeHTML($name).'="'.\OCP\Util::sanitizeHTML($value).'"';
}