wpcf7_sanitize_query_var()
Sanitizes the query variables.
Хуков нет.
Возвращает
Строку. Text sanitized.
Использование
wpcf7_sanitize_query_var( $text );
- $text(строка) (обязательный)
- Query variable.
Код wpcf7_sanitize_query_var() wpcf7 sanitize query var CF7 6.1.5
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;
}