Title:
File include via CFSCRIPT "include" or CFINCLUDE generates an error if path includes extra "/" marks.
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/Duplicate
Reporter/Name(from Bugbase): Wes Byrd / Wes Byrd (Wes Byrd)
Created: 02/28/2012
Components: Language
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Public Beta /
Priority/Frequency: Major / Most users will encounter
Locale/System: English / Win All
Vote Count: 0
Duplicate ID: CF-3129772
Problem Description:
When including a file via CFINCLUDE or via "include" in CFSCRIPT, an error "Could not find the included template" is generated if the path includes an extra "/" mark. This does not happen in previous version of CF. This may cause errors when customers upgrade from CF9 (or earlier) to CF10.
Steps to Reproduce:
<cfinclude template="/path/to//file.cfm" />
<cfscript>include "/path/to//file.cfm"; </cfscript>
Where "/path/to/file.cfm" does not cause an error message.
Actual Result:
An error message "Could not find the included template". This kind of path is often created when a developer programs a dynamic path... such as...
<cfinclude template="#application.incFilePath#/#url.incFile#" /> ... or something similar.
In this case, if the Application variable ends in "/" or if the URL variable begins with "/", CF10 will cause and error where CF9 and previous would not.
Expected Result:
The developer will expect CF10 to treat CFINCLUDE the same way that was in CF9 and before.
Any Workarounds:
The only workaround is to fix your code or to fix your data to not have the extra "/" marks in the path. Or, we could write a function to clean up the paths before inserting into the CFINCLUDE tag. However, this would cause existing applications to be "fixed" in order to run CF10.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3125367
External Customer Info:
External Company:
External Customer Name: Wes Byrd
External Customer Email:
External Test Config: My Hardware and Environment details:
Using CF10 Public Beta (ColdFusion 10,281485) on Windows 7/IIS7 on a Dell Precision laptop.
I suspect this will occur on any Windows OS... not sure about Linux, but it most likely will do the same.
Attachments:
Comments: