From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox-widget-toolkit] utils: fix multi line error message rendering for store error mask
Date: Thu, 15 Oct 2026 17:11:10 +0200 [thread overview]
Message-ID: <20261015151110.425812-1-c.ebner@proxmox.com> (raw)
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
reply other threads:[~2026-10-15 15:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261015151110.425812-1-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox