瀏覽代碼

Escaping angle brackets in a device config file

The configuration file may contain brackets (">" or "<"), which must be escaped
Ursadon 4 年之前
父節點
當前提交
27f3816fc6
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      netbox/templates/dcim/device/config.html

+ 3 - 3
netbox/templates/dcim/device/config.html

@@ -39,9 +39,9 @@ $(document).ready(function() {
         url: "{% url 'dcim-api:device-napalm' pk=object.pk %}?method=get_config",
         dataType: 'json',
         success: function(json) {
-            $('#running_config').html($.trim(json['get_config']['running']));
-            $('#startup_config').html($.trim(json['get_config']['startup']));
-            $('#candidate_config').html($.trim(json['get_config']['candidate']));
+            $('#running_config').text($.trim(json['get_config']['running']));
+            $('#startup_config').text($.trim(json['get_config']['startup']));
+            $('#candidate_config').text($.trim(json['get_config']['candidate']));
         },
         error: function(xhr) {
             alert(xhr.responseText);