mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
KSES: Extend support in wp_kses_normalize_entities to named entities with up to two numbers on the end of the name so as to support a wider list of valid entities.
Fixes â#26290 Built from https://develop.svn.wordpress.org/trunk@26440 git-svn-id: http://core.svn.wordpress.org/trunk@26338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1858b65dbb
commit
e1e79ddf64
@ -446,6 +446,8 @@ if ( ! CUSTOM_TAGS ) {
|
|||||||
'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp',
|
'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp',
|
||||||
'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang',
|
'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang',
|
||||||
'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams',
|
'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams',
|
||||||
|
'sup1', 'sup2', 'sup3', 'frac14', 'frac12', 'frac34',
|
||||||
|
'there4',
|
||||||
);
|
);
|
||||||
|
|
||||||
$allowedposttags = array_map( '_wp_add_global_attributes', $allowedposttags );
|
$allowedposttags = array_map( '_wp_add_global_attributes', $allowedposttags );
|
||||||
@ -1119,7 +1121,7 @@ function wp_kses_normalize_entities($string) {
|
|||||||
|
|
||||||
# Change back the allowed entities in our entity whitelist
|
# Change back the allowed entities in our entity whitelist
|
||||||
|
|
||||||
$string = preg_replace_callback('/&([A-Za-z]{2,8});/', 'wp_kses_named_entities', $string);
|
$string = preg_replace_callback('/&([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string);
|
||||||
$string = preg_replace_callback('/&#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string);
|
$string = preg_replace_callback('/&#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string);
|
||||||
$string = preg_replace_callback('/&#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string);
|
$string = preg_replace_callback('/&#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user