浏览代码

[web] alerts - fixed double quotes and escaped html

Signed-off-by: Kristian Feldsam <feldsam@gmail.com>
Kristian Feldsam 3 年之前
父节点
当前提交
a7612e6c39
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      data/web/inc/footer.inc.php
  2. 1 1
      data/web/templates/base.twig

+ 1 - 1
data/web/inc/footer.inc.php

@@ -16,7 +16,7 @@ if (is_array($alertbox_log_parser)) {
   }
   $alert = array_filter(array_unique($alerts));
   foreach($alert as $alert_type => $alert_msg) {
-    $alerts[$alert_type] = json_encode(implode('<hr class="alert-hr">', $alert_msg));
+    $alerts[$alert_type] = implode('<hr class="alert-hr">', $alert_msg);
   }
   unset($_SESSION['return']);
 }

+ 1 - 1
data/web/templates/base.twig

@@ -170,7 +170,7 @@ function recursiveBase64StrToArrayBuffer(obj) {
     // TFA, CSRF, Alerts in footer.inc.php
     // Other general functions in mailcow.js
     {% for alert_type, alert_msg in alerts %}
-    mailcow_alert_box("{{ alert_msg }}", "{{ alert_type }}");
+    mailcow_alert_box('{{ alert_msg|raw }}', '{{ alert_type }}');
     {% endfor %}
 
     // Confirm TFA modal