]> git.proxmox.com Git - pmg-docs.git/commitdiff
api-viewer: properly HTML encode properties
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Aug 2019 10:53:17 +0000 (12:53 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Aug 2019 10:53:19 +0000 (12:53 +0200)
and fix missing closing </pre> tag

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
api-viewer/PMGAPI.js

index e4504af545e6edbd566305571f4aef7e864e6b91..6488e3ebf4c9327aec2f66aca4f72e19a2b07f5b 100644 (file)
@@ -198,12 +198,12 @@ Ext.onReady(function() {
 
                    var returnhtml;
                    if (retinf.items) {
-                       returnhtml = '<pre>items: ' + JSON.stringify(retinf.items, null, 4) + '</pre>';
+                       returnhtml = '<pre>items: ' + Ext.htmlEncode(JSON.stringify(retinf.items, null, 4)) + '</pre>';
                    }
 
                    if (retinf.properties) {
                        returnhtml = returnhtml || '';
-                       returnhtml += '<pre>properties:' + JSON.stringify(retinf.properties, null, 4);
+                       returnhtml += '<pre>properties:' + Ext.htmlEncode(JSON.stringify(retinf.properties, null, 4)) + '</pre>';
                    }
 
                   sections.push({