Advertisements

wp_kses_decode_entities

Definition:
function wp_kses_decode_entities($string) {}

Convert all entities to their character counterparts.
This function decodes numeric HTML entities (A and A). It doesn’t do anything with other entities like ä, but we don’t need them in the URL protocol whitelisting system anyway.

Parameters

  • string $string: Content to change entities

Return values

returns:Content after decoded entities

Source code

function wp_kses_decode_entities($string) {

	$string = preg_replace_callback('/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $string);

	$string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $string);



	return $string;

}

3825

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: