Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 01/06/2015
Components: File Management
Versions: 11.0
Failure Type: Data Corruption
Found In Build/Fixed In Build: CF11_Final / CF10 Update16
Priority/Frequency: Normal / Some users will encounter
Locale/System: ALL / Platforms All
Vote Count: 0
CF rewrites file://host as file:////host. This causes exceptions and unexpected results (and potential date corruption due to directoryList() and <cfdirectory action="list" returning an incorrect number of rows).
Steps to reproduce:
1) Create C:\ticket3863993 and share it as ticket3863993
2) Create C:\ticket3863993\myfile.txt
3) Run the following code:
<cfscript>
//These fail or return incorrect results
writeDump(directoryExists("file://localhost/C:/ticket3863993"));//Returns NO
q = directoryList("file://localhost/ticket3863993", true, "query");
writeDump(q);//Directory column contains file:////localhost/ticket3863993/ instead of file://localhost/ticket3863993/
q = directoryList("file://localhost/C:/ticket3863993", true, "query");//Throws exception: The specified directory file:////localhost/C:/ticket3863993 does not exist.
writeDump(q);
//These succeed
writeDump(directoryExists("file:///C:/ticket3863993"));//Returns YES
q = directoryList("file:///C:/ticket3863993", true, "query");
writeDump(q);
</cfscript>
<!--- These fail or return incorrect results --->
<cfdirectory action="list" name="q" directory="file://localhost/ticket3863993">
<cfdump var="#q#"><!--- Directory column contains file:////localhost/ticket3863993/ instead of file://localhost/ticket3863993/ --->
<cfdirectory action="list" name="q" directory="file://localhost/C:/ticket3863993">
<cfdump var="#q#"><!--- Returns 0 results --->
<!--- These succeed --->
<cfdirectory action="list" name="q" directory="file://localhost/ticket3863993">
<cfdump var="#q#">
Per http://en.wikipedia.org/wiki/File_URI_scheme, a file URI takes the form of file://host/path and host is treated as "localhost" if omitted. CF is incorrectly rewriting file://host as file:////host.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3916425
External Customer Info:
External Company:
External Customer Name: itisdesign
External Customer Email:
Attachments:
Comments: