Replace named HTML entity with decimal HTML entity

WP `esc_html()` function escapes the valid named HTML entity `ă` and this is causing problems for some state names (see issue #18355). This commit provides a workaround by replacing `ă` with its decimal HTML entity version `ă`.

The WP core ticket below added a whilelist of named HTML entity but there is no explanation why some named HTML entities, like `ă`, were not included in the list and thus are escaped:

https://core.trac.wordpress.org/ticket/12284

Fixes #18355
This commit is contained in:
Rodrigo Primo 2018-01-05 12:08:14 -02:00
parent 9818ed10f9
commit 5116cd0bd3
2 changed files with 16 additions and 16 deletions

View File

@ -19,24 +19,24 @@ if ( ! defined( 'ABSPATH' ) ) {
}
$states['MD'] = array(
'C' => __( 'Chișinău', 'woocommerce' ),
'BL' => __( 'Bălți', 'woocommerce' ),
'C' => __( 'Chișinău', 'woocommerce' ),
'BL' => __( 'Bălți', 'woocommerce' ),
'AN' => __( 'Anenii Noi', 'woocommerce' ),
'BS' => __( 'Basarabeasca', 'woocommerce' ),
'BR' => __( 'Briceni', 'woocommerce' ),
'CH' => __( 'Cahul', 'woocommerce' ),
'CT' => __( 'Cantemir', 'woocommerce' ),
'CL' => __( 'Călărași', 'woocommerce' ),
'CS' => __( 'Căușeni', 'woocommerce' ),
'CL' => __( 'Călărași', 'woocommerce' ),
'CS' => __( 'Căușeni', 'woocommerce' ),
'CM' => __( 'Cimișlia', 'woocommerce' ),
'CR' => __( 'Criuleni', 'woocommerce' ),
'DN' => __( 'Dondușeni', 'woocommerce' ),
'DR' => __( 'Drochia', 'woocommerce' ),
'DB' => __( 'Dubăsari', 'woocommerce' ),
'DB' => __( 'Dubăsari', 'woocommerce' ),
'ED' => __( 'Edineț', 'woocommerce' ),
'FL' => __( 'Fălești', 'woocommerce' ),
'FL' => __( 'Fălești', 'woocommerce' ),
'FR' => __( 'Florești', 'woocommerce' ),
'GE' => __( 'UTA Găgăuzia', 'woocommerce' ),
'GE' => __( 'UTA Găgăuzia', 'woocommerce' ),
'GL' => __( 'Glodeni', 'woocommerce' ),
'HN' => __( 'Hîncești', 'woocommerce' ),
'IL' => __( 'Ialoveni', 'woocommerce' ),
@ -48,9 +48,9 @@ $states['MD'] = array(
'RS' => __( 'Rîșcani', 'woocommerce' ),
'SG' => __( 'Sîngerei', 'woocommerce' ),
'SR' => __( 'Soroca', 'woocommerce' ),
'ST' => __( 'Strășeni', 'woocommerce' ),
'SD' => __( 'Șoldănești', 'woocommerce' ),
'SV' => __( 'Ștefan Vodă', 'woocommerce' ),
'ST' => __( 'Strășeni', 'woocommerce' ),
'SD' => __( 'Șoldănești', 'woocommerce' ),
'SV' => __( 'Ștefan Vodă', 'woocommerce' ),
'TR' => __( 'Taraclia', 'woocommerce' ),
'TL' => __( 'Telenești', 'woocommerce' ),
'UN' => __( 'Ungheni', 'woocommerce' ),

View File

@ -19,15 +19,15 @@ $states['RO'] = array(
'AB' => __( 'Alba', 'woocommerce' ),
'AR' => __( 'Arad', 'woocommerce' ),
'AG' => __( 'Argeș', 'woocommerce' ),
'BC' => __( 'Bacău', 'woocommerce' ),
'BC' => __( 'Bacău', 'woocommerce' ),
'BH' => __( 'Bihor', 'woocommerce' ),
'BN' => __( 'Bistrița-Năsăud', 'woocommerce' ),
'BN' => __( 'Bistrița-Năsăud', 'woocommerce' ),
'BT' => __( 'Botoșani', 'woocommerce' ),
'BR' => __( 'Brăila', 'woocommerce' ),
'BR' => __( 'Brăila', 'woocommerce' ),
'BV' => __( 'Brașov', 'woocommerce' ),
'B' => __( 'București', 'woocommerce' ),
'BZ' => __( 'Buzău', 'woocommerce' ),
'CL' => __( 'Călărași', 'woocommerce' ),
'BZ' => __( 'Buzău', 'woocommerce' ),
'CL' => __( 'Călărași', 'woocommerce' ),
'CS' => __( 'Caraș-Severin', 'woocommerce' ),
'CJ' => __( 'Cluj', 'woocommerce' ),
'CT' => __( 'Constanța', 'woocommerce' ),
@ -48,7 +48,7 @@ $states['RO'] = array(
'NT' => __( 'Neamț', 'woocommerce' ),
'OT' => __( 'Olt', 'woocommerce' ),
'PH' => __( 'Prahova', 'woocommerce' ),
'SJ' => __( 'Sălaj', 'woocommerce' ),
'SJ' => __( 'Sălaj', 'woocommerce' ),
'SM' => __( 'Satu Mare', 'woocommerce' ),
'SB' => __( 'Sibiu', 'woocommerce' ),
'SV' => __( 'Suceava', 'woocommerce' ),