nope.

What version of CF?
What OS?
What web server software?

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: Gyrus [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 8:44 AM
To: CF-Talk
Subject: utterly, utterly bizarre <CFEXIT> problem (kinda long but
funny)


I've just encountered one of the weirdest CF problems I've
ever seen, and even though I've found out how to stop it
happening now, I'm still completely baffled, and wondering
if anyone out there can shed some light on it.

It's happened in an intranet I'm developing, so all I can
provide is screen grabs and code, but here goes...

There's a form for adding a page to the intranet, and
I'm using a slightly customised ezEdit to allow people to
enter intro copy for the page. This is what the form looks
like (screen grab):

http://www.tengai.co.uk/test/tpintranet_OK.gif

When it's submitted, the introCopy field contents are
passed to a custom tag, act_markupSweep.cfm, which
basically just gets rid of any 'dangerous' or non-compliant
markup code that might have been entered.

I ran into a problem with this tag when the user enters
nothing. Certain Len() functions in the tag throw errors
if it's passed a zero-length string, so I put this code in
at the top of the tag:

<cfif attributes.HTML EQ "">
    <cfset caller.markupSweepResult="">
    <cfexit>
</cfif>

Seemed pretty straightforward. Hah!

If the form is submitted with something in introCopy, it
works fine, and (if you've left out the required Title as
well), displays the form again like this:

http://www.tengai.co.uk/test/tpintranet_OK2.gif

But, if you submit the form with *nothing* in the
introCopy bit, this happens:

http://www.tengai.co.uk/test/tpintranet_WEIRDERROR.gif

That strange tangle of bits of source code continues off
the right of the screen. And no, there are *no* CF
errors hidden in the debug output off the bottom of the
screen.

It *looks* like a broken HTML tag. But check out the
source code:

http://www.tengai.co.uk/test/tpintranet_WEIRDERROR.zip

If you run this through the W3C validator
(http://makeashorterlink.com/?J11A6546), it balks at all
the ezEdit stuff that's proprietary IE stuff, of course,
but there's not a whiff of a broken tag. (The only change
I made to the source is to cut out the CF debug output,
which makes the Validator output way too long!)

Even more bizarre, if I save the source out as a HTML
document and place it in the root of the site (to get
all the relative image links and so on), it looks like this:

http://www.tengai.co.uk/test/tpintranet_WEIRDERROR2.gif

This has got me and my colleague COMPLETELY MYSTIFIED.
How can a page display broken like that, have its source
saved out, and then display fine??!!!

After much cursing and scratching of heads, I managed to
stop the page display from breaking. How? I removed the
<cfexit> tag from the act_markupSweep.cfm custom tag.

I made it so it does this instead:

<cfif attributes.HTML EQ "">
    <cfset caller.markupSweepResult="">
    <cfelse>
        [ normal tag processing ]
</cfif>

This works fine!

Q: How can a <cfexit> tag running on the server affect how
a browser renders a certain source file that's given to it?

The only thing I can think of is some *really* obscure part
of the HTTP header that's affected by the <cfexit> tag.
This would explain why the page displays OK if you save the
source out as static HTML and load that.

As I said, I can turn this problem "on and off" in a reliable
fashion by using or removing the <cfexit> tag, so I know how
to solve the problem. I'm just too baffled to leave it be!
(Maybe sign of an immature coder - not fully learnt to leave
bugs behind if you can find the *solution* but not the
*explanation*! ;)

BTW, I've tried this in Netscape 6 - which gets given a
plain textarea instead of ezEdit, so ezEdit has nothing to
do with it. And the weird <style> and <script> comments
are catch-alls that work in older browsers and XML
browsers, I just used them habitually so I don't have to
think about what comments to use each time. I've tried
removing them, no difference.

Anyone had this before?!

- Gyrus

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- [EMAIL PROTECTED]
work: http://www.tengai.co.uk
play: http://www.norlonto.net
- PGP key available
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to