diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php
index e2e61e67e2c9a..7eb1cf5ffa460 100644
--- a/core/templates/layout.base.php
+++ b/core/templates/layout.base.php
@@ -12,20 +12,13 @@
-
-
-
-
-
-
+
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index 2c2373d53aa2c..dc56edb0061f4 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -13,20 +13,13 @@
-
-
-
-
-
-
+
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 978534b869c24..aad9875f37576 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -21,20 +21,13 @@
-
-
-
-
-
-
+
diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php
index b4c69327438fe..4f7c11d0b64da 100644
--- a/lib/private/legacy/template.php
+++ b/lib/private/legacy/template.php
@@ -12,6 +12,7 @@
* @author Joas Schilling
* @author Jörn Friedrich Dreyer
* @author Lukas Reschke
+ * @author Michael Letzgus
* @author Morris Jobke
* @author Raghu Nayyar
* @author Robin Appelman
@@ -208,6 +209,9 @@ public function fetchPage($additionalParams = null) {
$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).'"';
}
diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php
index 7814918b8151b..06eb512b54f5d 100644
--- a/lib/private/legacy/template/functions.php
+++ b/lib/private/legacy/template/functions.php
@@ -7,6 +7,7 @@
* @author Joas Schilling
* @author Jörn Friedrich Dreyer
* @author Lukas Reschke
+ * @author Michael Letzgus
* @author Morris Jobke
* @author Robin McCorkell
* @author Roeland Jago Douma
@@ -37,6 +38,42 @@ function p($string) {
print(\OCP\Util::sanitizeHTML($string));
}
+/**
+ * Prints a ';
+ print_unescaped($s."\n");
+}
+
+/**
+ * Print all