well you know that the variabled will be defined

so why not something like this

<cfscript>

        function getValue()
                {
                if (isDefined(arguments[1]))
                        {return evaluate(arguments[1]));}
                else
                        {
                        if (arrayLen(arguments) GT 1)
                                {return arguments[2];}
                        else
                                {return "";}
                        }
                }

        function replaceValues(inStr)
                {
                regExp = "%[^%]*%";
                if (REFind(regExp, inStr))
                        {
                        do      {
                                value = REFindNoCase(regExp,inStr,1,"TRUE");
                                inStr = replace(inStr,
                                                                
Mid(inStr,value.pos[1],value.len[1]),
                                                                
getValue(Mid(inStr,value.pos[2],value.len[2]),""),
                                                                "ALL"
                                                                );
                                }
                                while (REFindNoCase(regExp,inStr) NEQ 0);
                        }
                }
</cfscript>

then just call

<cfoutput>#replaceValue(somestring)#</cfoutput>

Just something to think about

Steve

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mark Mandel
Sent: Thursday, July 01, 2004 4:56 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Parsing DB content containing CF Vars


> The reality is all i want to do is to convert app vars into their values,
> and other email addresses embedded in the content. Ive got a UDF thats
> rewriting the email addresses so spammers cant collect them. And thats
it...
> Nothing too fancy..

I've come in a bit late - but I know in one of my mailing list
sofwares I had a list of 'words' the user could enter, and they would
be evaluated into certain dynamic values.

I.e. '%Name%' would turn into the Person recieving the email's name...
'%From%' would display the From email.. etc.

So why not provide the user with a series of those? rather than open
yourself up to malicious code?

Hope I didn't miss someone suggesting this.

Mark

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to