public static Html::decodeEntities($text)
Decodes all HTML entities including numerical ones to regular UTF-8 bytes.
Double-escaped entities will only be decoded once ("&lt;" becomes "<", not "<"). Be careful when using this function, as it will revert previous sanitization efforts (<script> will become <script>).
This method is not the opposite of Html::escape(). For example, this method will convert "é" to "é", whereas Html::escape() will not convert "é" to "é".
string $text: The text to decode entities in.
string The input $text, with all HTML entities decoded once.
\Drupal\Component\Utility\Html::escape()
public static function decodeEntities($text) { return html_entity_decode($text, ENT_QUOTES, 'UTF-8'); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Html.php/function/Html::decodeEntities/8.1.x