The EE 5.1.3 docs refer to a common function html_escape()
But when I try to use this function in my custom module code, I get Fatal error: Call to undefined function html_escape() in...
This is my code for testing purposes:
$recipientAddress = 'My Name <[email protected]>';
echo html_escape($recipientAddress);
I searched the entire EE system directory for the string html_escape
, but it wasn’t found. I also checked a fresh download of EE 5.1.3 just to make sure that my copy wasn’t missing a file. Nada.
Am I calling this function incorrectly?
Are the docs incorrect? Has this function been removed from EE?
Darin
Sorry about that, the helper function must have been removed. As the description of the function says though, it’s more just an alias for htmlspecialchars()
that allows you to pass in an array of strings, so you should be able to replicate the functionality by calling htmlspecialchars()
on it’s own for single strings, or in use it with array_map()
if you have an array of strings.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.