sanitize

Masks sensitive values, such as passwords, API keys and tokens, found in a string.

sanitize(text [, replacement]) → returns string

This function requires Lucee 7 and up.  Not supported on Adobe ColdFusion, etc.

Argument Reference

text string
Required

The string to sanitize.

replacement string
Default: ****

The text that replaces each sensitive value.

Examples
Sample code invoking the sanitize function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub