DreamweaverMX Keeps Rewriting my Code -
07-09-2003
, 10:55 AM
For some reason, when I open some files, DreamweaverMX adds in extra tags, usually closing CFIFs. This results in the pages breaking if I don't notice the rewrite and fix it, and it's causing me a lot of headaches. I've installed the 6.1 Updater and turned off all of the rewriting options in Preferences and it is still doing it.
I've attached one of the files it rewrites. When I open it, it adds anywhere from two to four closing CFIFs near the end at the line indicated. I like MX and I'd like to keep using it, but I really can't deal with being unable to trust it to leave my code alone. Is there any fix for this?
<!--
************************************************** *******************
Padding to make sure IE takes our refreshes since it is so picky about
the size of custom error messages. If this padding is removed, IE 5.5
and up will not do the redirects causing an insane number of errors to
appear, so do not delete these comments!!!
************************************************** *******************
-->
<cfif FindNoCase("pubs", CGI.REQUEST_URI) NEQ 0>
<META HTTP-EQUIV="Refresh" CONTENT="0;url=http://tcebookstore.org/">
<cfelseif FindNoCase("btfly", CGI.REQUEST_URI)>
<META HTTP-EQUIV="Refresh" CONTENT="0;url=http://tcebookstore.org/pubinfo.cfm?pubid=1143">
<cfelseif FindNoCase("wildflr", CGI.REQUEST_URI)>
<META HTTP-EQUIV="Refresh" CONTENT="0;url=http://tcebookstore.org/pubinfo.cfm?pubid=1368">
<cfelseif FindNoCase("catalog", CGI.REQUEST_URI) NEQ 0>
<META HTTP-EQUIV="Refresh" CONTENT="0;url=http://tcebookstore.org/">
<cfelseif FindNoCase("clipart", CGI.REQUEST_URI) NEQ 0>
<META HTTP-EQUIV="Refresh" CONTENT="0;url=http://clipart.tamu.edu">
<cfelseif FindNoCase("tmppdfs", CGI.REQUEST_URI) NEQ 0>
<cflocation url="http://tcebookstore.org/nohotlinking.cfm?REFERREDBY=#CGI.HTTP_REFERER#">
<cfelseif FindNoCase("formmail.pl", CGI.REQUEST_URI) NEQ 0 OR FindNoCase("formmail.cgi", CGI.REQUEST_URI) NEQ 0 OR FindNoCase(".exe", CGI.REQUEST_URI) NEQ 0 OR FindNoCase("cgi", CGI.REQUEST_URI) NEQ 0 OR FindNoCase("agsearch", HTTP_REFERER) NEQ 0>
<META HTTP-EQUIV="Refresh" CONTENT="0;url=http://tcebookstore.org/">
<cfelse>
<!---
ColdFusion ErrorDoc
Summer S. Wilson; Texas Cooperative Extension
sswilson (AT) tamu (DOT) edu
v 1.0 December 05, 2002 - first version
This application has been released under the GNU license, therefore
you are free to use or modify this script as needed. Email me
any improvements to have them included in the next version.
This application comes with no implied nor implicit warranty.
This application was adapted from phpErrorDoc Written by Jason Rust
--->
<!--- Change these variables to match your site and configuration --->
<!--- The e-mail address of the person to notify when an error occurs. --->
<cfset notify="sswilson (AT) tamu (DOT) edu">
<!--- Return address; required by some email systems --->
<cfset returnaddress="sswilson (AT) tamu (DOT) edu">
<!--- The name of your site --->
<cfset sitename="TCE Bookstore">
<!--- Site URL --->
<cfset returnLink="http://tcebookstore.org">
<!--- Full path to the error log --->
<cfset errorLog = "c:\inetpub\wwwroot\adminny\cfmerror_log.log">
<!--- colors for the tables error page below --->
<!--- background color of the table --->
<cfset table_bg_color = "dedef6">
<!--- text color of the table --->
<cfset table_fg_color = "000000">
<!--- background color of the cell on the left with a image --->
<cfset image_bg_color = "ffffff">
<!--- color of the header text --->
<cfset header_color = "DD0101">
<!--- To customize look --->
<!--- The name of your header file, which has all the HTML to appear BEFORE the error message --->
<cfset headerfile = "header.cfm">
<!--- The name of your footer file, which has all the HTML to appear AFTER the error message --->
<cfset footerfile = "footer.cfm">
<!--- These are the Subject Lines for the e-mail notification; You can modify these without causing any problems. --->
<cfset subject000 = "Unknown Error">
<cfset subject400 = "Bad Request">
<cfset subject401 = "No Authorization">
<cfset subject403 = "Forbidden URL">
<cfset subject404 = "Missing URL">
<cfset subject500 = "Configuration Error">
<!--- Change the N to Y if you want to receive e-mail when a particular error occurs. --->
<cfset email000 = "Y">
<cfset email400 = "Y">
<cfset email401 = "Y">
<cfset email403 = "Y">
<cfset email404 = "Y">
<cfset email500 = "Y">
<!--- Change the N to Y if you want to log a particular error to file --->
<cfset log000 = "Y">
<cfset log400 = "Y">
<cfset log401 = "Y">
<cfset log403 = "Y">
<cfset log404 = "Y">
<cfset log500 = "Y">
<!--- edit the html error messages below to suit your needs. --->
<!--- HTML CODE TO APPEAR WHEN AN UNKNOWN ERROR OCCURS --->
<cfset msg000 = "<strong>The page you requested, #returnlink##CGI.REQUEST_URI# resulted in an unknown error code. It is possible that the condition causing the problem will be gone by the time you finish reading this, so please try refreshing or reloading the page.<br><br>We have been notified this error and will correct the problem.</strong>">
<!--- HTML CODE TO APPEAR WHEN A BAD REQUEST OCCURS --->
<cfset msg400 = "<strong>The page you requested, #returnlink##CGI.REQUEST_URI# was a bad request.</strong>">
<!--- HTML CODE TO APPEAR WHEN AN UNAUTHORIZED PAGE ACCESS ATTEMPT OCCURS --->
<cfset msg401 = "<strong>You have attempted to access an area of the site for which you have no authorization. #returnlink##CGI.REQUEST_URI#.</strong>">
<!--- HTML CODE TO APPEAR WHEN A FORBIDDEN ATTEMPT IS MADE --->
<cfset msg403 = "<strong>You can not access #returnlink##CGI.REQUEST_URI#. More than likely, you have either attempted to directly link to one of our PDFs or to view a directory's contents, both of which are forbidden. Please use the menu to the right to navigate to where you wish to be on our site.</strong>">
<!--- HTML CODE TO APPEAR WHEN A DOCUMENT NOT FOUND HAPPENS --->
<cfif FindNoCase("errordoc", CGI.REQUEST_URI) EQ 0>
<cfset msg404 = "<strong>The page you requested, #returnlink##CGI.REQUEST_URI#, could not be found. The most likly cause is that you mistyped the URL, someone else has posted a bad link to our site, or we have a broken link. <br><br>We have been notified this error and will correct it if it is caused by a broken link on our end.</strong>">
<cfelse>
<cfset msg404 = "<strong>The page you requested could not be found. The most likly cause is that you mistyped the URL, someone else has posted a bad link to our site, or we have a broken link. <br><br>We have been notified this error and will correct it if it is caused by a broken link on our end.</strong>">
</cfif>
<!--- HTML CODE TO APPEAR WHEN A SERVER CONFIGURATION ERROR OCCURS --->
<cfset msg500 = "<strong>The page you requested, #returnlink##CGI.REQUEST_URI# resulted in a server configuration error. More than likely the condition causing the problem will be gone by the time you finish reading this, so hit refresh to try again.<br><br>We have been notified this error and will correct the problem.</strong>">
<!--- you shouldn't need to change anything below here --->
<cfset errorcode = errorcode>
<CFIF errorcode NEQ 400 AND errorcode NEQ 401 AND errorcode NEQ 403 AND errorcode NEQ 404 AND errorcode NEQ 500>
<cfset errorcode = 000>
</CFIF>
<cfif CGI.REMOTE_ADDR NEQ "165.91.107.27" and errorcode NEQ 400 AND FindNoCase("Googlebot", CGI.HTTP_USER_AGENT) EQ 0>
<!--- Email error if requested --->
<cfif Evaluate("email#errorcode#") EQ "Y">
<cfmail to="#notify#" from="#returnaddress#" subject="Error On #sitename# - #Evaluate("subject#errorcode#")#">
Site: #sitename# (#CGI.SERVER_NAME#)
Error Code: #errorcode# #Evaluate("subject#errorcode#")# (#CGI.REDIRECT_ERROR_NOTES#)
Occurred: #DateFormat(Now(), "mm/dd/yyyy")#
Requested URL: #returnlink##CGI.REQUEST_URI#
User Address: #CGI.REMOTE_ADDR#
User Agent: #CGI.HTTP_USER_AGENT#
Referer: #CGI.HTTP_REFERER#
</cfmail>
</cfif>
<!--- Write error to log if requested --->
<cfif Evaluate("log#errorcode#") EQ "Y">
<!---
You can change the format of this, if desired, to use HTML. Just make sure you
keep the variables that you want to see and that you surround them with pound signs!
--->
<CFFILE action="APPEND"
file="#errorLog#"
output="<strong>#DateFormat(Now(), "mm/dd/yyyy")#</strong><dl><dt>#errorcode# Error</dt><dd>#Evaluate("subject#errorcode#")# Requested URL: #returnlink##CGI.REQUEST_URI#<BR>[client: #CGI.REMOTE_ADDR# (#CGI.HTTP_USER_AGENT#]</dd></dl>"
addnewline="Yes">
</cfif>
</cfif>
<cfif CGI.REMOTE_ADDR EQ "152.163.189.68" OR CGI.REMOTE_ADDR EQ "165.95.50.146" or CGI.REMOTE_ADDR EQ "200.158.181.222">
<cflocation url="http://tcebookstore.org/stopit.cfm">
</cfif>
<cfinclude template="#headerfile#">
<cfoutput>
<td valign="top">
<BR><BR>
<table bgcolor="###table_bg_color#" border="1" align="center" cellspacing="0" cellpadding="5" color="###table_fg_color#">
<tr>
<td>
<div style="font-weight: 600; color: ###header_color#">#sitename#</span> <strong>Error #errorcode#</strong>
<cfif cgi.REDIRECT_ERROR_NOTES NEQ "">
(#cgi.REDIRECT_ERROR_NOTES#)</p>
</cfif>
<p>
#Evaluate("msg#errorcode#")#
</p>
</div>
<div align="center">A copy of this error has been sent to our webmaster.</div>
</td>
</tr>
</table>
</td>
<td>
<cfinclude template="rightsidemenu.cfm">
<p><img src="/images/pubproducts.jpg" width="200" height="351" align="middle" alt="A display of various extension publications available through this site." onMouseOver="hidemenu()"></p>
</td>
</tr>
</table>
</cfoutput><!--- CFIFS get added here --->
<cfinclude template="#footerfile#">
</cfif>
Summer S. Wilson Collectonian on Yahoo
Programmer/Analyst I, EIT TCE
An Eclectic World (http://eclectic-world.com)
BVMMUG (http://bvmmug.tamu.edu)
Eclectic Designs (http://eclectic-designs.com)
EZ Learn Photography (http://www.ezlearnphotography.com)
LearnCF (http://learncf.tamu.edu) |