Re: Scary fun with variables scopes.

2007-10-05 Thread James Holmes
You can, of course, protect yourself from this:


 Session Variable evaluated true.
 

On 10/5/07, Ian Skinner <[EMAIL PROTECTED]> wrote:
> Give this a try if you have a moment.
>
> Put this code in a file test.cfm.  Note: no  tag.
>
> Session.test: #session.test#
> 
> Session Variable evaluated true.
> 
>
> Then call the page with this url:  http://aDomain/test.cfm?session.test=true
>
> Is this discussed or documented somewhere?

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290420
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Janet MacKay
>You will see that the exact same phenomenon occurs; when the struct already
>exists, CF cannot implicitly create it and creates a variable with the name
>provided.

It doesn't seem to matter whether a structure exists or not. 

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290415
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Claude Schneegans
 >>CF cannot create it so it treats it as a
variable "session.test" that it places into the URL scope.

And this is what is inconsistent, since a variable cannot have a dot in 
its name.

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290414
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Scary fun with variables scopes.

2007-10-05 Thread Rich
>  >>I don't think its a structure.  Just a variable name with a "." in it.
> 
> But this is unconsistent with the way CF really works:
> Try 
> 
> 
> CFDUMP shows that test is a structure with a variable " test", not a
> variable "test.test"

The way CF "really works" in the example you provided is implicitly creating
a structure when you use that syntax.  In the previous example, since
session is an existing structure CF cannot create it so it treats it as a
variable "session.test" that it places into the URL scope.

You can test this behavior by running the code below:

 




If you place these in a file (test.cfm) and browse them with the following
urls:

Test.cfm
Test.cfm?tester.test=1

You will see that the exact same phenomenon occurs; when the struct already
exists, CF cannot implicitly create it and creates a variable with the name
provided.

HTH, 

Rich Kroll


~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290399
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Claude Schneegans
 >>But I guess that's the point. Its not a structure in this case. Dump 
#URL# and the value is not shown as a structure. Its a simple value ie 
"test.test".

That's not only the point, it is also an issue, since in theory, 
variable cannot have dots in their names.
So CF is actually creating an illegal variable... what a shame!


~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290395
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Janet MacKay
>But this is unconsistent with the way CF really works:
>Try 
>
>
>CFDUMP shows that test is a structure with a variable " test", not a 
>variable "test.test"

But I guess that's the point. Its not a structure in this case. Dump #URL# and 
the value is not shown as a structure. Its a simple value ie "test.test".



~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290386
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Claude Schneegans
 >>I don't think its a structure.  Just a variable name with a "." in it.

But this is unconsistent with the way CF really works:
Try 


CFDUMP shows that test is a structure with a variable " test", not a 
variable "test.test"

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290385
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Janet MacKay
>I tried it, and dumped session: test is not there, you must have created
>another struct named "session", I tried dumping variables it is not there?

Its not a structure, but you'll see it if you dump the url scope. 

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290366
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Janet MacKay
>seems it creates a struct called session in the url scope: var="#url#" />

I don't think its a structure.  Just a variable name with a "." in it. 

~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290369
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Ron Gowen
seems it creates a struct called session in the url scope: 

On 10/5/07, Ron Gowen <[EMAIL PROTECTED]> wrote:
>
> I tried it, and dumped session: test is not there, you must have created
> another struct named "session", I tried dumping variables it is not there?
>
>
>
> On 10/5/07, Ian Skinner <[EMAIL PROTECTED]> wrote:
> >
> > Give this a try if you have a moment.
> >
> > Put this code in a file test.cfm.  Note: no  tag.
> >
> > Session.test: #session.test#
> > 
> >Session Variable evaluated true.
> > 
> >
> > Then call the page with this url:  
> > http://aDomain/test.cfm?session.test=true
> >
> > Is this discussed or documented somewhere?
> >
> >
> >
> >
> > 

~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290367
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Janet MacKay
>I don't think its a structure.  Just a variable name with a "." in it.

Nm. I see Charlie Griefer already explained that :) 

~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290370
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Ron Gowen
I tried it, and dumped session: test is not there, you must have created
another struct named "session", I tried dumping variables it is not there?



On 10/5/07, Ian Skinner <[EMAIL PROTECTED]> wrote:
>
> Give this a try if you have a moment.
>
> Put this code in a file test.cfm.  Note: no  tag.
>
> Session.test: #session.test#
> 
>Session Variable evaluated true.
> 
>
> Then call the page with this url:
> http://aDomain/test.cfm?session.test=true
>
> Is this discussed or documented somewhere?
>
>
>
>
> 

~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290365
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Janet MacKay
Does this work for anyone if the variable name is something other than session? 

Test


~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290362
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Scary fun with variables scopes.

2007-10-05 Thread Charlie Griefer
add this:

#isSimpleValue(session.test)# <-- YES
 <-- error

which is weird because as of CFMX, creating a variable with a dot in
the name will implicitly create a struct (soo  would create a struct named 'foo' with a key named 'bar' and equal
to 123).

I guess the fact that 'session' is a reserved word prohibits CF from
creating it as a struct so you get a simple value of "session.test"
equal to 'true'.

so basically the bottom line is... you're not manipulating the
"session" (which doesn't even exist).

On 10/5/07, Ian Skinner <[EMAIL PROTECTED]> wrote:
> Give this a try if you have a moment.
>
> Put this code in a file test.cfm.  Note: no  tag.
>
> Session.test: #session.test#
> 
> Session Variable evaluated true.
> 
>
> Then call the page with this url:  http://aDomain/test.cfm?session.test=true
>
> Is this discussed or documented somewhere?
>
>
>
>
> 

~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290356
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Scary fun with variables scopes.

2007-10-05 Thread Rich
Ian,
ColdFusion is evaluating the line  and is looking
through all known scopes and is finding URL['session.text'], treating it as
a variable name, which is evaluating to true.  Ben Nadel discussed this type
of non-assertive scope reference in a recent blog post
(http://www.bennadel.com/blog/957-Code-Assertively.htm).

HTH,
Rich Kroll 


~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290355
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Scary fun with variables scopes.

2007-10-05 Thread Ian Skinner
Give this a try if you have a moment.

Put this code in a file test.cfm.  Note: no  tag.

Session.test: #session.test#

Session Variable evaluated true.


Then call the page with this url:  http://aDomain/test.cfm?session.test=true

Is this discussed or documented somewhere?




~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290343
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4