diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-04-13 10:55:09 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-04-13 15:52:05 +0200 |
commit | ee79612fc7f33d87f6cc722cdd3e669eaa79bd98 (patch) | |
tree | 77e1439202c0f8ba8056726392852ccf1a5db192 /cui | |
parent | 39f1c0cd1dcaa4c0caed15355b4ff8163c14f1d6 (diff) |
tdf#83877 Make user input xml safe
Change-Id: Iff1311932ef6a4525faa999553884bd8d23f3f30
Reviewed-on: https://gerrit.libreoffice.org/52814
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/SignSignatureLineDialog.cxx | 5 | ||||
-rw-r--r-- | cui/source/dialogs/SignatureLineDialog.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/SignatureLineDialogBase.cxx | 5 | ||||
-rw-r--r-- | cui/source/inc/SignSignatureLineDialog.hxx | 1 | ||||
-rw-r--r-- | cui/source/inc/SignatureLineDialogBase.hxx | 1 |
5 files changed, 8 insertions, 8 deletions
diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx index 94366aa34f5c..3c3052901c26 100644 --- a/cui/source/dialogs/SignSignatureLineDialog.cxx +++ b/cui/source/dialogs/SignSignatureLineDialog.cxx @@ -148,9 +148,4 @@ void SignSignatureLineDialog::Apply() m_xShapeProperties->setPropertyValue("Graphic", Any(xGraphic)); } -OUString SignSignatureLineDialog::getCDataString(const OUString& rString) -{ - return "<![CDATA[" + rString + "]]>"; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/dialogs/SignatureLineDialog.cxx b/cui/source/dialogs/SignatureLineDialog.cxx index ee98a98b37c2..a1716fe282b6 100644 --- a/cui/source/dialogs/SignatureLineDialog.cxx +++ b/cui/source/dialogs/SignatureLineDialog.cxx @@ -101,8 +101,8 @@ void SignatureLineDialog::Apply() // Read svg and replace placeholder texts OUString aSvgImage(getSignatureImage()); - aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", aSignerName); - aSvgImage = aSvgImage.replaceAll("[SIGNER_TITLE]", aSignerTitle); + aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", getCDataString(aSignerName)); + aSvgImage = aSvgImage.replaceAll("[SIGNER_TITLE]", getCDataString(aSignerTitle)); // These are only filled if the signature line is signed. aSvgImage = aSvgImage.replaceAll("[SIGNATURE]", ""); diff --git a/cui/source/dialogs/SignatureLineDialogBase.cxx b/cui/source/dialogs/SignatureLineDialogBase.cxx index 894694784d35..dcd05d6ee504 100644 --- a/cui/source/dialogs/SignatureLineDialogBase.cxx +++ b/cui/source/dialogs/SignatureLineDialogBase.cxx @@ -30,6 +30,11 @@ short SignatureLineDialogBase::execute() return nRet; } +OUString SignatureLineDialogBase::getCDataString(const OUString& rString) +{ + return "<![CDATA[" + rString + "]]>"; +} + OUString SignatureLineDialogBase::getSignatureImage() { OUString const svg( diff --git a/cui/source/inc/SignSignatureLineDialog.hxx b/cui/source/inc/SignSignatureLineDialog.hxx index 7847c70f059f..c7a6e565bd7b 100644 --- a/cui/source/inc/SignSignatureLineDialog.hxx +++ b/cui/source/inc/SignSignatureLineDialog.hxx @@ -35,7 +35,6 @@ private: void ValidateFields(); virtual void Apply() override; - OUString getCDataString(const OUString& rString); DECL_LINK(chooseCertificate, weld::Button&, void); }; diff --git a/cui/source/inc/SignatureLineDialogBase.hxx b/cui/source/inc/SignatureLineDialogBase.hxx index 34496344801a..8954ecd98a60 100644 --- a/cui/source/inc/SignatureLineDialogBase.hxx +++ b/cui/source/inc/SignatureLineDialogBase.hxx @@ -26,6 +26,7 @@ protected: css::uno::Reference<css::frame::XModel> m_xModel; OUString getSignatureImage(); virtual void Apply() = 0; + OUString getCDataString(const OUString& rString); }; #endif |