WordPress开发者和主题制作者的搜索引擎



wp_kses_js_entities ›

Since1.0.0
已弃用4.7.0
wp_kses_js_entities ( $string )
参数:
  • (string) $string
    Required: Yes
返回:
  • (string)
定义在:
文档:

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

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.



源码

function wp_kses_js_entities( $string ) {
	_deprecated_function( __FUNCTION__, '4.7.0' );

	return preg_replace( '%&\s*\{[^}]*(\}\s*;?|$)%', '', $string );
}