Skip to content

Commit

Permalink
Escape HTML chars (open-eid#1257)
Browse files Browse the repository at this point in the history
IB-8019

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored May 6, 2024
1 parent a72b79e commit 1e9d99e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/dialogs/SignatureDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ SignatureDialog::SignatureDialog(const DigiDocSignature &signature, QWidget *par
d->showErrors->show();

QString name = !c.isNull() ? c.toString(c.showCN() ? QStringLiteral("CN serialNumber") : QStringLiteral("GN SN serialNumber")) : s.signedBy();
d->title->setText(QStringLiteral("%1 | %2%3</font>").arg(name, style, status));
d->title->setText(QStringLiteral("%1 | %2%3</font>").arg(name.toHtmlEscaped(), style, status));
d->close->setFont(Styles::font(Styles::Condensed, 14));
connect(d->close, &QPushButton::clicked, this, &SignatureDialog::accept);

Expand Down
15 changes: 15 additions & 0 deletions client/dialogs/SignatureDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ QScrollBar::sub-line:vertical {
<height>31</height>
</size>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
Expand Down Expand Up @@ -231,6 +234,9 @@ QScrollBar::sub-line:vertical {
<height>31</height>
</size>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
Expand Down Expand Up @@ -260,6 +266,9 @@ QScrollBar::sub-line:vertical {
<height>31</height>
</size>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
Expand Down Expand Up @@ -289,6 +298,9 @@ QScrollBar::sub-line:vertical {
<height>31</height>
</size>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
Expand Down Expand Up @@ -327,6 +339,9 @@ QScrollBar::sub-line:vertical {
<height>300</height>
</size>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
Expand Down
2 changes: 1 addition & 1 deletion client/widgets/AddressItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ AddressItem::AddressItem(CKey k, QWidget *parent, bool showIcon)
ui->key.cert.subjectInfo("GN").join(' ') + " " + ui->key.cert.subjectInfo("SN").join(' ') :
ui->key.cert.subjectInfo("CN").join(' ')).toHtmlEscaped();
if(ui->label.isEmpty())
ui->label = ui->key.recipient;
ui->label = ui->key.recipient.toHtmlEscaped();
setIdType();
showButton(AddressItem::Remove);
}
Expand Down

0 comments on commit 1e9d99e

Please sign in to comment.