We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Call to undefined function html_escape()

Development and Programming

Darin's avatar
Darin
7 posts
6 years ago
Darin's avatar Darin

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

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
6 years ago
Kevin Cupp's avatar Kevin Cupp

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.