convert_invalid_entities( string $content )

Converts invalid Unicode references range to valid range.


Parameters

$content

(Required) String with entities that need converting.


Return

(string) Converted string.


Source

File: wp-includes/formatting.php

function convert_invalid_entities( $content ) {
	$wp_htmltranswinuni = array(
		'€' => '€', // the Euro sign
		'' => '',
		'‚' => '‚', // these are Windows CP1252 specific characters
		'ƒ' => 'ƒ',  // they would look weird on non-Windows browsers
		'„' => '„',
		'…' => '…',
		'†' => '†',
		'‡' => '‡',
		'ˆ' => 'ˆ',
		'‰' => '‰',
		'Š' => 'Š',
		'‹' => '‹',
		'Œ' => 'Œ',
		'' => '',
		'Ž' => 'Ž',
		'' => '',
		'' => '',
		'‘' => '‘',
		'’' => '’',
		'“' => '“',
		'”' => '”',
		'•' => '•',
		'–' => '–',
		'—' => '—',
		'˜' => '˜',
		'™' => '™',
		'š' => 'š',
		'›' => '›',
		'œ' => 'œ',
		'' => '',
		'ž' => 'ž',
		'Ÿ' => 'Ÿ'
	);

	if ( strpos( $content, '&#1' ) !== false ) {
		$content = strtr( $content, $wp_htmltranswinuni );
	}

	return $content;
}

Changelog

Changelog
Version Description
WP-4.3.0 Introduced.