wpcf7_sanitize_query_var()CF7 1.0

Sanitizes the query variables.

Хуков нет.

Возвращает

Строку. Text sanitized.

Использование

wpcf7_sanitize_query_var( $text );
$text(строка) (обязательный)
Query variable.

Код wpcf7_sanitize_query_var() CF7 5.9.3

function wpcf7_sanitize_query_var( $text ) {
	$text = wp_unslash( $text );
	$text = wp_check_invalid_utf8( $text );

	if ( false !== strpos( $text, '<' ) ) {
		$text = wp_pre_kses_less_than( $text );
		$text = wp_strip_all_tags( $text );
	}

	$text = preg_replace( '/%[a-f0-9]{2}/i', '', $text );
	$text = preg_replace( '/ +/', ' ', $text );
	$text = trim( $text, ' ' );

	return $text;
}