wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_kses_no_null › WordPress Function

Od1.0.0
Przestarzałyn/a
wp_kses_no_null ( $content, $options = null )
Parametry: (2)
  • (string) $content Content to filter null characters from.
    Wymagane: Tak
  • (array) $options Set 'slash_zero' => 'keep' when '\0' is allowed. Default is 'remove'.
    Wymagane: Nie
    Domyślny: null
Powrót:
  • (string) Filtered content.
Zdefiniowane na:
Codex:

Removes any invalid control characters in a text string.

Also removes any instance of the string.


Źródło

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

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

	return $content;
}