wp_kses_bad_protocol


wp_kses_bad_protocol ( $content, $allowed_protocols )

Parameters:
  • (string) content Content to filter bad protocols from.
  • (string[]) allowed_protocols Array of allowed URL protocols.
Returns:
  • (string) Filtered content.
Defined at:

Description

Sanitizes a string and removed disallowed URL protocols.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)`.

Related Functions

wp_kses_bad_protocol_once, wp_allowed_protocols, wp_kses_post, wp_get_server_protocol, wp_kses_allowed_html

Top Google Results

User discussions

wpseek mobile