function check_plain

Encodes special characters in a plain-text string for display as HTML.

Also validates strings as UTF-8.

Parameters

$text: The text to be checked or processed.

Return value

An HTML safe version of $text, or an empty string if $text is not valid UTF-8.

See also

drupal_validate_utf8()

Related topics

262 calls to check_plain()
action_admin_manage in drupal/core/modules/action/action.admin.inc
Menu callback; Displays an overview of available and configured actions.
action_views_form_substitutions in drupal/core/modules/action/action.views.inc
Implements hook_views_form_substitutions().
aggregator_block_view in drupal/core/modules/aggregator/aggregator.module
Implements hook_block_view().
aggregator_categorize_items in drupal/core/modules/aggregator/aggregator.pages.inc
Form constructor to build the page list form.
aggregator_form_feed in drupal/core/modules/aggregator/aggregator.admin.inc
Form constructor for adding and editing feed sources.

... See full list

15 string references to 'check_plain'
AccountFormController::form in drupal/core/modules/user/lib/Drupal/user/AccountFormController.php
Overrides Drupal\Core\Entity\EntityFormController::form().
aggregator_form_opml in drupal/core/modules/aggregator/aggregator.admin.inc
Form constructor for importing feeds from OPML.
AttributeArray::__toString in drupal/core/lib/Drupal/Core/Template/AttributeArray.php
Implements the magic __toString() method.
block_admin_configure in drupal/core/modules/block/block.admin.inc
Form constructor for the block configuration form.
FilterPluginBase::buildExposeForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
Options form subform for exposed filter options.

... See full list

File

drupal/core/includes/bootstrap.inc, line 1585
Functions that need to be loaded on every Drupal request.

Code

function check_plain($text) {
  return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}