Max Paperno wrote:

> Greetings,
> 
> I've identified a somewhat minor but possibly damaging bug in CF 5.


It is not a bug.

>  It's pretty strange, but true.  Zac Belado has confirmed that this

was also the problem in his case (see his "Page Processing Twice" message from earlier 
today).  It seems to only affect CF5 (4.5 was also tried) but so far only tested on 
W2K.


Why you believe this is unclear to me. There must be differences in 
server setup.

> The bug causes a template to be executed twice by the CF engine.  It literally runs 
>everything connected to the request twice (all includes, parent template, etc).  
>There is no indication of this unless you have data that is noticeably affected (such 
>as inserting DB records).  The HTTP request is not doubled, only the actual CF code 
>execution.  This is not browser or Web server-related in any way.


It is browser related.



> The cause seems to be missing cfoutput tags around a variable call, and apparently 
>specifically in an IMG tag (some others were tried with no problems surfacing).


I would imagine this would also surface with objects, javascript 
includes etc.

> So some code like this:
> 
> <img src="#variables.someVariable#/test.gif">
> 
> (w/out cfoutput tags anywhere around it) will cause double execution.  Wrap it in 
>cfoutputs (or in comments) and the problem goes away.
> 
> Strange, no?


Not strange at all.

This is what happens. Inside the page you send to the browser is the 
following HTML.
<img src="#someVariable#/test.gif">

The browser expects to have to display an image with a relavtive 
location of "#someVariable#/test.gif". But since # means that it is a 
named object inside the same page the browser repeats the request to the 
webserver to get the same page again. Just like you would use target="#" 
to make a form post back to itself.

If I run your template normally.

Webserver log:
2001-12-11 09:43:08 130.161.67.244 - W3SVC1 SPIKE GET 
/jochemd/bugtest.cfm - 200 641 502 0 HTTP/1.1 
Mozilla/5.0+(Windows;+U;+WinNT4.0;+en-US;+rv:0.9.5)+Gecko/20011011 
CFID=63542;+CFTOKEN=51494371 -
2001-12-11 09:43:08 130.161.67.244 - W3SVC1 SPIKE GET 
/jochemd/bugtest.cfm - 200 643 560 16 HTTP/1.1 
Mozilla/5.0+(Windows;+U;+WinNT4.0;+en-US;+rv:0.9.5)+Gecko/20011011 
CFID=63542;+CFTOKEN=51494371 http://spike.oli.tudelft.nl/jochemd/bugtest.cfm

BugTestLog.txt:
Ran at {ts '2001-12-11 10:43:08'}
Ran at {ts '2001-12-11 10:43:08'}

But now I disable the automatic loading of images in my browser 
(Mozilla: Edit, Preferences, Privacy & Security, Images, "Do not load 
any images").

webserver log:
2001-12-11 09:46:27 130.161.67.244 - W3SVC1 SPIKE GET 
/jochemd/bugtest.cfm - 200 641 502 0 HTTP/1.1 
Mozilla/5.0+(Windows;+U;+WinNT4.0;+en-US;+rv:0.9.5)+Gecko/20011011 
CFID=63542;+CFTOKEN=51494371 -

BugTestLog.txt:
Ran at {ts '2001-12-11 10:46:27'}

FYI:
Browser: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.5) Gecko/20011011
Server: NT4 SP6a + Security Rolup Package
Webserver: IIS 4 + Security Rollup Package (15 august I believe)
CF: 4.5.1 SP2 Enterprise + Security Fixes

Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to