Check Flags Before Using Them

If is often necessary to pass flags (TRUE/FLASE values, often as 0 and 1) from page to page. Before using these flags you should check that they are in fact valid boolean values (just to be sure they did not get changed or tampered with). The simplest way to do this is using the IsBoolean() function – pass it the value and it’ll return TRUE if it is a valid boolean flag (TRUE or FALSE, YES or NO, 0 or non-0) and FALSE if not. (Applies to: ColdFusion All)

Leave a Reply