[wp-trac] [WordPress Trac] #53019: The _sanitize_text_fields function removing the octets that incorrectly work with Arabic RTL languages.

WordPress Trac noreply at wordpress.org
Tue Mar 14 02:52:04 UTC 2023


#53019: The _sanitize_text_fields function removing the octets that incorrectly
work with Arabic RTL languages.
--------------------------+------------------------------
 Reporter:  wppunk        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Security      |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  rtl
--------------------------+------------------------------

Comment (by erengy):

 Bumped into this when a customer was unable to edit the discount label of
 a product. The text was in Turkish, which is written left to right. The
 issue may affect two other LTR languages (Basque and Kurdish) as well.

 Using the following Python script on https://github.com/unicode-org/cldr-
 json:

 {{{#!python
 import json
 import os

 for locale in os.listdir('./cldr-numbers-full/main/'):
   with open(f'./main/{locale}/numbers.json', encoding='utf-8') as file:
     data = json.load(file)
     numbers = data['main'][locale]['numbers']
     percent_format = numbers['percentFormats-numberSystem-
 latn']['standard']
     if percent_format.startswith('%'):
       print(f'{locale:<10}{percent_format}')
 }}}

 Output:

 {{{
 eu        % #,##0
 ku        %#,##0
 tr        %#,##0
 tr-CY     %#,##0
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53019#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list