funky_javascript_fix()WP 1.5.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Fixes JavaScript bugs in browsers.

Converts unicode characters to HTML numbered entities.

No Hooks.

Return

String. Fixed text.

Usage

funky_javascript_fix( $text );
$text(string) (required)
Text to be made safe.

Notes

  • Global. $is_macIE
  • Global. $is_winIE

Changelog

Since 1.5.0 Introduced.
Deprecated since 3.0.0

funky_javascript_fix() code WP 6.5.2

function funky_javascript_fix($text) {
	_deprecated_function( __FUNCTION__, '3.0.0' );
	// Fixes for browsers' JavaScript bugs.
	global $is_macIE, $is_winIE;

	if ( $is_winIE || $is_macIE )
		$text =  preg_replace_callback("/\%u([0-9A-F]{4,4})/",
					"funky_javascript_callback",
					$text);

	return $text;
}