Changeset 11828
- Timestamp:
- 08/16/2009 05:58:39 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/kses.php
r11699 r11828 1028 1028 */ 1029 1029 function wp_kses_decode_entities($string) { 1030 $string = preg_replace_callback('/&#([0-9]+);/', create_function('$match', 'return chr($match[1]);'), $string);1031 $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', create_function('$match', 'return chr(hexdec($match[1]));'), $string);1030 $string = preg_replace_callback('/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $string); 1031 $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $string); 1032 1032 1033 1033 return $string; 1034 } 1035 1036 /** 1037 * Regex callback for wp_kses_decode_entities() 1038 * 1039 * @param array $match preg match 1040 * @return string 1041 */ 1042 function _wp_kses_decode_entities_chr( $match ) { 1043 return chr( $match[1] ); 1044 } 1045 1046 /** 1047 * Regex callback for wp_kses_decode_entities() 1048 * 1049 * @param array $match preg match 1050 * @return string 1051 */ 1052 function _wp_kses_decode_entities_chr_hexdec( $match ) { 1053 return chr( hexdec( $match[1] ) ); 1034 1054 } 1035 1055
Note: See TracChangeset
for help on using the changeset viewer.