wp_kses_js_entities

Removes the HTML JavaScript entities found in early versions of Netscape 4.

Description

(string) wp_kses_js_entities( (string) $string ); 

Previously, this function was pulled in from the original import of kses and removed a specific vulnerability only existent in early version of Netscape 4. However, this vulnerability never affected any other browsers and can be considered safe for the modern web.

The regular expression which sanitized this vulnerability has been removed in consideration of the performance and energy demands it placed, now merely passing through its input to the return.

Returns (string)

Parameters (1)

0. $string (string)
The string.

Usage

  1. if ( !function_exists( 'wp_kses_js_entities' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The string. 
  5. $string = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_kses_js_entities($string); 
  9.  

Defined (1)

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

/wp-includes/deprecated.php  
  1. function wp_kses_js_entities( $string ) { 
  2. _deprecated_function( __FUNCTION__, '4.7.0' ); 
  3.  
  4. return preg_replace( '%&\s*\{[^}]*(\}\s*;?|$)%', '', $string );