From c3935bae7d7f3d340c36e0c08ace59d0743bd9eb Mon Sep 17 00:00:00 2001 From: lyn1001 Date: Mon, 15 Jan 2024 17:46:23 +0800 Subject: [PATCH] Avoid verbatim bidi formatting characters in the source code (cherry picked from commit c3e1202ff9d91d38e05ffa71b5b6de074fc32ee7) --- ...atting-characters-in-the-source-code.patch | 60 +++++++++++++++++++ ibus-typing-booster.spec | 8 ++- 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 Avoid-verbatim-bidi-formatting-characters-in-the-source-code.patch diff --git a/Avoid-verbatim-bidi-formatting-characters-in-the-source-code.patch b/Avoid-verbatim-bidi-formatting-characters-in-the-source-code.patch new file mode 100644 index 0000000..6798dcb --- /dev/null +++ b/Avoid-verbatim-bidi-formatting-characters-in-the-source-code.patch @@ -0,0 +1,60 @@ +From eacecffd63187ca8c77936e007fcd6f30c02ad17 Mon Sep 17 00:00:00 2001 +From: Mike FABIAN +Date: Mon, 9 Oct 2023 17:43:16 +0200 +Subject: [PATCH] Avoid verbatim bidi formatting characters in the source code + +They were used only in doc tests, which should not be any security +risk. But some versions of rpminspect complain about this, so avoid +them and use '\u....' instead. +--- + engine/itb_util.py | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/engine/itb_util.py b/engine/itb_util.py +index fce1b023..78b73ff6 100644 +--- a/engine/itb_util.py ++++ b/engine/itb_util.py +@@ -2890,6 +2890,9 @@ + TR9> and its matching PDI or, if it has no matching PDI, the end of the + TR9> paragraph + ++ U+2069 POP DIRECTIONAL ISOLATE ++ U+2068 FIRST STRONG ISOLATE ++ + Examples: + + >>> is_right_to_left('Hallo!') +@@ -2898,16 +2901,16 @@ + >>> is_right_to_left('﷼') + True + +- >>> is_right_to_left('⁨﷼⁩') ++ >>> is_right_to_left('\u2068﷼\u2069') + False + +- >>> is_right_to_left('⁨﷼⁩﷼') ++ >>> is_right_to_left('\u2068﷼\u2069﷼') + True + +- >>> is_right_to_left('a⁨﷼⁩﷼') ++ >>> is_right_to_left('a\u2068﷼\u2069﷼') + False + +- >>> is_right_to_left('⁨a⁩⁨﷼⁩﷼') ++ >>> is_right_to_left('\u2068a\u2069\u2068﷼\u2069﷼') + True + ''' + skip = False +@@ -2937,10 +2940,10 @@ + Examples: + + >>> bidi_embed('a') +- '‪a‬' ++ '\u202Aa\u202C' + + >>> bidi_embed('﷼') +- '‫﷼‬' ++ '\u202B﷼\u202C' + ''' + if is_right_to_left(text): + return chr(0x202B) + text + chr(0x202C) # RLE + text + PDF diff --git a/ibus-typing-booster.spec b/ibus-typing-booster.spec index 27ed0de..d4a48d1 100644 --- a/ibus-typing-booster.spec +++ b/ibus-typing-booster.spec @@ -1,13 +1,14 @@ %define with_check 0 Name: ibus-typing-booster Version: 2.16.0 -Release: 1 +Release: 2 Summary: A completion input method to speedup typing License: GPLv3+, ASL 2.0 URL: https://mike-fabian.github.io/ibus-typing-booster/ Source0: https://github.com/mike-fabian/ibus-typing-booster/releases/download/%{version}/ibus-typing-booster-%{version}.tar.gz +Patch0: Avoid-verbatim-bidi-formatting-characters-in-the-source-code.patch BuildArch: noarch BuildRequires: ibus-devel m17n-db-extras libappstream-glib glib2 BuildRequires: python3-devel python3-pyxdg python3-enchant @@ -28,7 +29,7 @@ Ibus-typing-booster is a completion input method to speedup typing. %package_help %prep -%autosetup -n %{name}-%{version} +%autosetup -n %{name}-%{version} -p1 %build export PYTHON=%{__python3} @@ -113,6 +114,9 @@ make check || cat ./tests/test-suite.log %changelog +* Mon Jan 15 2024 liyanan - 2.16.0-2 +- Avoid verbatim bidi formatting characters in the source code + * Tue Jun 21 2022 SimpleUpdate Robot - 2.16.0-1 - Upgrade to version 2.16.0 -- Gitee