Changeset 13988 for trunk/wp-includes/formatting.php
- Timestamp:
- 04/04/2010 07:11:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r13983 r13988 953 953 954 954 return $content; 955 }956 957 /**958 * Callback used to change %uXXXX to &#YYY; syntax959 *960 * @since 2.8?961 *962 * @param array $matches Single Match963 * @return string An HTML entity964 */965 function funky_javascript_callback($matches) {966 return "&#".base_convert($matches[1],16,10).";";967 }968 969 /**970 * Fixes javascript bugs in browsers.971 *972 * Converts unicode characters to HTML numbered entities.973 *974 * @since 1.5.0975 * @uses $is_macIE976 * @uses $is_winIE977 *978 * @param string $text Text to be made safe.979 * @return string Fixed text.980 */981 function funky_javascript_fix($text) {982 // Fixes for browsers' javascript bugs983 global $is_macIE, $is_winIE;984 985 if ( $is_winIE || $is_macIE )986 $text = preg_replace_callback("/\%u([0-9A-F]{4,4})/",987 "funky_javascript_callback",988 $text);989 990 return $text;991 955 } 992 956
Note: See TracChangeset
for help on using the changeset viewer.