Avoid verbatim bidi formatting characters in the source code

(cherry picked from commit c3e1202ff9d91d38e05ffa71b5b6de074fc32ee7)
This commit is contained in:
lyn1001 2024-01-15 17:46:23 +08:00 committed by openeuler-sync-bot
parent 965f50fe45
commit c3935bae7d
2 changed files with 66 additions and 2 deletions

View File

@ -0,0 +1,60 @@
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
@@ -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

View File

@ -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 <liyanan61@h-partners.com> - 2.16.0-2
- Avoid verbatim bidi formatting characters in the source code
* Tue Jun 21 2022 SimpleUpdate Robot <tc@openeuler.org> - 2.16.0-1
- Upgrade to version 2.16.0