wp_kses_html_error( string $attr ): string

Handles parsing errors in wp_kses_hair().

Description

The general plan is to remove everything to and including some whitespace, but it deals with quotes and apostrophes as well.

Parameters

$attrstringrequired

Return

string

Source

function wp_kses_html_error( $attr ) {
	return preg_replace( '/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $attr );
}

Changelog

VersionDescription
1.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.