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

XSS Clean

Development and Programming

funnEE's avatar
funnEE
93 posts
4 years ago
funnEE's avatar funnEE

I am having trouble with xss_clean. My logs tell me it is depreciated but I don’t see in the docs what to use instead. When I try to search for “ee(‘Security/XSS’)->clean()” in the docs, nothing comes up. I do find xss_clean in the legacy software page of the docs, but it does not refer me to what I should use instead.

https://docs.expressionengine.com/latest/development/guidelines/security.html#cross-site-scripting-xss

Please point me in the right direction.

Log Error Message: “Deprecated function xss_clean() called in system/expressionengine/libraries/Functions.php(627) : eval()’d code on line 51. Deprecated since 3.0. Use ee(‘Security/XSS’)->clean() instead.”

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
4 years ago
Robin Sowell's avatar Robin Sowell

Try

$out = ee('Security/XSS')->clean($string);

It’s actually a modern library. But it looks like we need to add that to the docs!

       

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.