* [PATCH proxmox-widget-toolkit] utils: fix multi line error message rendering for store error mask
@ 2026-10-15 15:11 Christian Ebner
0 siblings, 0 replies; only message in thread
From: Christian Ebner @ 2026-10-15 15:11 UTC (permalink / raw)
To: pve-devel
Since commit 86b2264d ("utils: mon store errors: htmlEncode error
message") the full message passed to the error mask is html encoded.
This however leads to incorrect rendering of multiline errors, since
gathered via Proxmox.Utils.getResponseErrorMessage() separates lines
via `<br>` tag and already html encodes them. One crucial exception
is however the error status text, not covered by html encoding in
Proxmox.Utils.getResponseErrorMessage().
Since the current implementation breaks multi-line error rendering
for several places in the PBS UI, fix the rendering by not encoding
the full return value of Proxmox.Utils.getResponseErrorMessage(),
but rather limit to the content of the error itself.
Fixes:86b2264d ("utils: mon store errors: htmlEncode error message")
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/Utils.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Utils.js b/src/Utils.js
index cd24787..73189fd 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -414,7 +414,7 @@ Ext.define('Proxmox.Utils', {
if (!err.statusText) {
return gettext('Connection error');
}
- let msg = [`${err.statusText} (${err.status})`];
+ let msg = [Ext.String.htmlEncode(`${err.statusText} (${err.status})`)];
if (err.response && err.response.responseText) {
let txt = err.response.responseText;
try {
@@ -468,7 +468,7 @@ Ext.define('Proxmox.Utils', {
let error = request._operation.getError();
let msg = Proxmox.Utils.getResponseErrorMessage(error);
if (!errorCallback || !errorCallback(error, msg)) {
- Proxmox.Utils.setErrorMask(component, Ext.htmlEncode(msg));
+ Proxmox.Utils.setErrorMask(component, msg);
}
});
},
--
2.47.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-15 15:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 15:11 [PATCH proxmox-widget-toolkit] utils: fix multi line error message rendering for store error mask Christian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox