[Libreoffice-commits] core.git: 2 commits - cui/source sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Jul 17 16:23:20 UTC 2018
cui/source/dialogs/cuicharmap.cxx | 6 +++---
sw/source/filter/html/htmlgrin.cxx | 16 +++++++++++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
New commits:
commit 4d18cd6aad0daaefaca792e8eac173bea07f3750
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 17 09:58:56 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 17 18:23:11 2018 +0200
put load of html images (to measure dimensions) under referer control
Change-Id: I1de4a5214ef48394dcafa97e4ea12bb460f2fba2
Reviewed-on: https://gerrit.libreoffice.org/57564
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 8b3ddaf0f601..db0cc4701e36 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -299,6 +299,20 @@ void SwHTMLParser::GetDefaultScriptType( ScriptType& rType,
rTypeStr = GetScriptTypeString( pHeaderAttrs );
}
+namespace
+{
+ bool allowAccessLink(SwDoc& rDoc)
+ {
+ OUString sReferer;
+ SfxObjectShell * sh = rDoc.GetPersist();
+ if (sh != nullptr && sh->HasName())
+ {
+ sReferer = sh->GetMedium()->GetName();
+ }
+ return !SvtSecurityOptions().isUntrustedReferer(sReferer);
+ }
+}
+
/* */
void SwHTMLParser::InsertImage()
@@ -628,7 +642,7 @@ IMAGE_SETEVENT:
bool bSetScaleImageMap = false;
sal_uInt8 nPrcWidth = 0, nPrcHeight = 0;
- if (!nWidth || !nHeight)
+ if ((!nWidth || !nHeight) && allowAccessLink(*m_xDoc))
{
GraphicDescriptor aDescriptor(aGraphicURL);
if (aDescriptor.Detect(/*bExtendedInfo=*/true))
commit 19b3a353662c547b9e1a445c1bc71cf3bc107250
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 17 15:55:03 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 17 18:22:58 2018 +0200
Related: tdf#118681 use a case insensitive compare for hex digits
Change-Id: I7b177d2772a86cada37c20056794bc1d8ab50991
Reviewed-on: https://gerrit.libreoffice.org/57563
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 71c1360f4f7d..13e88e9df86d 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -976,8 +976,8 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void)
setCharName(cChar);
// Update the hex and decimal codes only if necessary
- if (m_xHexCodeText->get_text() != aHexText)
- m_xHexCodeText->set_text( aHexText );
+ if (!m_xHexCodeText->get_text().equalsIgnoreAsciiCase(aHexText))
+ m_xHexCodeText->set_text(aHexText);
if (m_xDecimalCodeText->get_text() != aDecimalText)
m_xDecimalCodeText->set_text( aDecimalText );
@@ -1019,7 +1019,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharHighlightHdl, SvxShowCharSet*, void)
setCharName(cChar);
// Update the hex and decimal codes only if necessary
- if (m_xHexCodeText->get_text() != aHexText)
+ if (!m_xHexCodeText->get_text().equalsIgnoreAsciiCase(aHexText))
m_xHexCodeText->set_text(aHexText);
if (m_xDecimalCodeText->get_text() != aDecimalText)
m_xDecimalCodeText->set_text( aDecimalText );
More information about the Libreoffice-commits
mailing list