wp_kses_bad_protocol

SummerySummery

Sanitizes a string and removed disallowed URL protocols.

Syntax

wp_kses_bad_protocol( string $string, string[] $allowed_protocols )

DescriptionDescription

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

ParametersParameters

$string

(string) (Required) Content to filter bad protocols from.

$allowed_protocols

(string[]) (Required) Array of allowed URL protocols.

ReturnReturn

(string) Filtered content.

SourceSource

File: wp-includes/kses.php


			

ChangelogChangelog

Changelog
Version Description
1.0.0 Introduced.
Scroll to Top