Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_kses_no_null ›

Da1.0.0
Deprecaton/a
wp_kses_no_null ( $string, $options = null )
Parametri: (2)
  • (string) $string Content to filter null characters from.
    Richiesto:
  • (array) $options Set 'slash_zero' => 'keep' when '\0' is allowed. Default is 'remove'.
    Richiesto: No
    Default: null
Ritorna:
  • (string) Filtered content.
Definito a:
Codex:

Removes any invalid control characters in a text string.

Also removes any instance of the string.



Sorgenti

function wp_kses_no_null( $string, $options = null ) {
	if ( ! isset( $options['slash_zero'] ) ) {
		$options = array( 'slash_zero' => 'remove' );
	}

	$string = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $string );
	if ( 'remove' == $options['slash_zero'] ) {
		$string = preg_replace( '/\\\\+0+/', '', $string );
	}

	return $string;
}