Avoid verbatim bidi formatting characters in the source code

(cherry picked from commit b1dd81ce9ad35c6714c34c9b4facefdd9738a795)
This commit is contained in:
lyn1001 2024-01-15 16:13:26 +08:00 committed by openeuler-sync-bot
parent a181b7abcc
commit 2fc2e0a46a
2 changed files with 67 additions and 2 deletions

View File

@ -0,0 +1,61 @@
From eacecffd63187ca8c77936e007fcd6f30c02ad17 Mon Sep 17 00:00:00 2001
From: Mike FABIAN <mfabian@redhat.com>
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
@@ -1757,6 +1757,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!')
@@ -1765,16 +1768,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
@@ -1806,10 +1809,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

View File

@ -1,13 +1,14 @@
%define with_check 0
Name: ibus-typing-booster
Version: 2.1.2
Release: 3
Release: 4
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,5 +114,8 @@ make check || cat ./tests/test-suite.log
%changelog
* Mon Jan 15 2024 liyanan <liyanan61@h-partners.com> - 2.1.2-4
- Avoid verbatim bidi formatting characters in the source code
* Thu Nov 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.1.2-3
- Package init