Sanitization functions

Functions to sanitize values.

See for information on writing secure code.


drupal/includes/, line 1359
Common functions that many Drupal modules will need to reference.


Namesort descending Location Description
check_markup drupal/modules/filter/filter.module Runs all the enabled filters on a piece of text.
check_plain drupal/includes/ Encodes special characters in a plain-text string for display as HTML.
check_url drupal/includes/ Strips dangerous protocols from a URI and encodes it for output to HTML.
drupal_attributes drupal/includes/ Converts an associative array to an XML/HTML tag attribute string.
drupal_strip_dangerous_protocols drupal/includes/ Strips dangerous protocols (e.g. 'javascript:') from a URI.
filter_xss drupal/includes/ Filters HTML to prevent cross-site-scripting (XSS) vulnerabilities.
filter_xss_admin drupal/includes/ Applies a very permissive XSS/HTML filter for admin-only use.
filter_xss_bad_protocol drupal/includes/ Processes an HTML attribute value and strips dangerous protocols from URLs.
format_string drupal/includes/ Formats a string for HTML display by replacing variable placeholders.
get_t drupal/includes/ Returns the name of the proper localization function.
st drupal/includes/ Translates a string when some systems are not available.
t drupal/includes/ Translates a string to the current language or to a given language.
_filter_xss_attributes drupal/includes/ Processes a string of HTML attributes.
_filter_xss_split drupal/includes/ Processes an HTML tag.