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.

16 calls to decode_entities()
comment_submit in modules/comment/comment.module
Prepare a comment for submission.
DrupalWebTestCase::checkForMetaRefresh in modules/simpletest/drupal_web_test_case.php
Check for meta refresh tag and if found call drupalGet() recursively. This function looks for the http-equiv attribute to be set to "Refresh" and is case-sensitive.
drupal_html_to_text in includes/mail.inc
Transforms an HTML string into plain text, preserving its structure.
drupal_mail_format_display_name in includes/mail.inc
Return a RFC-2822 compliant "display-name" component.
FilterUnitTestCase::assertNoNormalized in modules/filter/filter.test
Asserts that text transformed to lowercase with HTML entities decoded does not contain a given string.

... See full list

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

File

includes/unicode.inc, line 462

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.