WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp kses bad protocol

Contents

Description

Sanitize string from bad protocols.

This function removes all non-allowed protocols from the beginning of $string. It ignores whitespace and the case of the letters, and it does understand HTML entities. It does its work in a while loop, so it won't be fooled by a string like 'javascript:javascript:alert(57)'.

Usage

<?php wp_kses_bad_protocol$string$allowed_protocols ); ?>

Parameters

$string
(string) (required) Content to filter bad protocols from
Default: None
$allowed_protocols
(array) (required) Allowed protocols to keep
Default: None

Return Values

(string) 
Filtered content

Examples

Notes

Change Log

Since: 1.0.0

Source File

wp_kses_bad_protocol() is located in wp-includes/kses.php.

Related

See also index of Function Reference and index of Template Tags.