ibus-typing-booster/Avoid-verbatim-bidi-formatting-characters-in-the-source-code.patch
lyn1001 c3935bae7d Avoid verbatim bidi formatting characters in the source code
(cherry picked from commit c3e1202ff9d91d38e05ffa71b5b6de074fc32ee7)
2024-01-15 18:11:23 +08:00

61 lines
1.6 KiB
Diff
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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