summaryrefslogtreecommitdiff
path: root/i18nutil
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2025-02-02 14:37:34 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2025-02-02 12:01:13 +0100
commit6d78861299331fdfa51a070ced1ce498ceff342f (patch)
treec6ec870131658798d271b6e99017b4ade5daca88 /i18nutil
parentea047987b57bcd683f397220d705503bc2bd0642 (diff)
tdf#164989: Disallow combining characters when a hex already appeared
We either expect a single (maybe combined) character to convert into "U+" notation, or a sequence of hexadecimal numbers (possibly with U+) for conversion to characters. If we already saw a hexadecimal ASCII character, it can't be preceded by a character combining with it, so stop as soon as such an unexpected character appears. Change-Id: Ic480fe8f173240eb263d5a77286b149c933049a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181007 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'i18nutil')
-rw-r--r--i18nutil/source/utility/unicode.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index d2d54e53623c..c9bfbeeb0a80 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -1065,7 +1065,7 @@ bool ToggleUnicodeCodepoint::AllowMoreInput(sal_uInt32 uChar)
switch ( unicode::getUnicodeType(uChar) )
{
case css::i18n::UnicodeType::SURROGATE:
- if( bPreventNonHex )
+ if (bPreventNonHex || mbIsHexString)
{
mbAllowMoreChars = false;
return false;
@@ -1096,7 +1096,7 @@ bool ToggleUnicodeCodepoint::AllowMoreInput(sal_uInt32 uChar)
case css::i18n::UnicodeType::NON_SPACING_MARK:
case css::i18n::UnicodeType::COMBINING_SPACING_MARK:
- if( bPreventNonHex )
+ if (bPreventNonHex || mbIsHexString)
{
mbAllowMoreChars = false;
return false;