Created
May 8, 2017 08:18
-
-
Save neokoenig/8405738d398b8555532fe0d1f0e21cca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Removes all HTML tags from a string. | |
* | |
* [section: View Helpers] | |
* [category: Sanitization Functions] | |
* | |
* @html The HTML to remove tag markup from. | |
*/ | |
public string function stripTags(required string html) { | |
local.rv = REReplaceNoCase(arguments.html, "<\ *[a-z].*?>", "", "all"); | |
local.rv = REReplaceNoCase(local.rv, "<\ */\ *[a-z].*?>", "", "all"); | |
return local.rv; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment