function decode_entities

Decodes all HTML entities (including numerical ones) to regular UTF-8 bytes.

Double-escaped entities will only be decoded once ("&amp;lt;" becomes "&lt;", not "<"). Be careful when using this function, as decode_entities can revert previous sanitization efforts (&lt;script&gt; will become <script>).

Parameters

$text: The text to decode entities in.

Return value

The input $text, with all HTML entities decoded once.

24 calls to decode_entities()
CommentFormController::submit in drupal/core/modules/comment/lib/Drupal/comment/CommentFormController.php
Overrides Drupal\Core\Entity\EntityFormController::submit().
ContextualLinks::render in drupal/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php
Render the contextual fields.
DisplayPluginBase::getArgumentsTokens in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Returns to tokens for arguments.
drupal_html_to_text in drupal/core/includes/mail.inc
Transforms an HTML string into plain text, preserving its structure.
FieldPluginBase::get_render_tokens in drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
Get the 'render' tokens to use for advanced rendering.

... See full list

1 string reference to 'decode_entities'
filter_xss_bad_protocol in drupal/core/includes/common.inc
Processes an HTML attribute value and strips dangerous protocols from URLs.

File

drupal/core/includes/unicode.inc, line 387

Code

function decode_entities($text) {
  return html_entity_decode($text, ENT_QUOTES, 'UTF-8');
}