decode_entities

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 6 decode_entities($text, $exclude = array())
8 – 7 decode_entities($text)

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.

▾ 14 functions call 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
Transform an HTML string into plain text, preserving the structure of the markup. Useful for preparing the body of a node to be sent by e-mail.
FilterUnitTestCase::assertNoNormalized in modules/filter/filter.test
Asserts that text transformed to lowercase with HTML entities decoded does not contain a given string.
FilterUnitTestCase::assertNormalized in modules/filter/filter.test
Asserts that a text transformed to lowercase with HTML entities decoded does contains a given string.
filter_xss_bad_protocol in includes/common.inc
Processes an HTML attribute value and ensures it does not contain an URL with a disallowed protocol (e.g. javascript:).
format_rss_channel in includes/common.inc
Formats an RSS channel.
locale_string_is_safe in includes/locale.inc
Check that a string is safe to be added or imported as a translation.
search_excerpt in modules/search/search.module
Returns snippets from a piece of text, with certain keywords highlighted. Used for formatting search results.
search_simplify in modules/search/search.module
Simplifies a string according to indexing rules.
UnicodeUnitTest::testDecodeEntities in modules/simpletest/tests/unicode.test
Test decode_entities().
_filter_url_parse_email_links in modules/filter/filter.module
preg_replace callback to make links out of e-mail addresses.
_filter_url_parse_full_links in modules/filter/filter.module
preg_replace callback to make links out of absolute URLs.
_filter_url_parse_partial_links in modules/filter/filter.module
preg_replace callback to make links out of domain names starting with "www."

Code

includes/unicode.inc, line 428

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