funky_javascript_fix

Fixes JavaScript bugs in browsers.

Description

(string) funky_javascript_fix( (string) $text ); 

Converts unicode characters to HTML numbered entities.

Returns (string)

Fixed text.

Parameters (1)

0. $text (string)
Text to be made safe.

Usage

  1. if ( !function_exists( 'funky_javascript_fix' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // Text to be made safe. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = funky_javascript_fix($text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function funky_javascript_fix($text) { 
  2. _deprecated_function( __FUNCTION__, '3.0.0' ); 
  3. // Fixes for browsers' JavaScript bugs. 
  4. global $is_macIE, $is_winIE; 
  5.  
  6. if ( $is_winIE || $is_macIE ) 
  7. $text = preg_replace_callback("/\%u([0-9A-F]{4, 4})/",  
  8. "funky_javascript_callback",  
  9. $text); 
  10.  
  11. return $text;