September 18, 2024
Strange Behavior in my web app after i move to CF2023
Comments
(1)
September 18, 2024
Strange Behavior in my web app after i move to CF2023
Explorer 2 posts
Followers: 1 people
(1)

Recently I moved to CF2023 from CF2016. When I started using this new ColdFusion version with my web application, it displays me the below strange text on the page when it refreshes. I don’t see the same with CF2016 version. Why am I getting this? Is there a way to suppress this message? if it is debugging message, can we write this to any log files instead of on the page. It won’t look good to be there on the page. Any quick help is appreciated. Also attached the screenshot for the reference.

“//make a fileOutputStream object to put the ZipOutputStream into var output = createObject(“java”,”java.io.FileOutputStream”).init(destZipName); //make a ZipOutputStream object to create the zip file var zipOutput = createObject(“java”,”java.util.zip.ZipOutputStream”).init(output); //make a byte array to use when creating the zip //yes, this is a bit of hack, but it works var byteArray = repeatString(” “,1024).getBytes(); //we’ll need to create an inputStream below for writing out to the zip file var input = “”; //we’ll be making zipEntries below, so make a variable to hold them var zipEntry = “”; var zipEntryPath = “”; //we’ll use this while reading each file var len = 0; //a var for looping below var ii = 1; //a an array of the files we’ll put into the zip var fileArray = arrayNew(1); //add files to file array object fileArray = listToArray(arguments.srcFileNames); // // And now, on to the zip file // //let’s use the maximum compression zipOutput.setLevel(9); //loop over the array of files we are going to zip, adding each to the zipOutput for(ii = 1; ii LTE arrayLen(fileArray); ii = ii + 1){ //make a fileInputStream object to read the file into input = createObject(“java”,”java.io.FileInputStream”).init(fileArray[ii]); //make an entry for this file zipEntryPath = listLast(fileArray[ii],””); zipEntry = createObject(“java”,”java.util.zip.ZipEntry”).init(zipEntryPath); //put the entry into the zipOutput stream zipOutput.putNextEntry(zipEntry); // Transfer bytes from the file to the ZIP file len = input.read(byteArray); while (len GT 0) { zipOutput.write(byteArray, 0, len); len = input.read(byteArray); } //close out this entry zipOutput.closeEntry(); input.close(); } //close the zipOutput zipOutput.close(); /** * Unzips a file to the specified directory. * * @param zipFilePath Path to the zip file (Required) * @param outputPath Path where the unzipped file(s) should go (Required) * @return void * @author Samuel Neff (sam@serndesign.com) * @version 1, September 1, 2003 */ var zipFile = “”; // ZipFile var entries = “”; // Enumeration of ZipEntry var entry = “”; // ZipEntry var fil = “”; //File var inStream = “”; var filOutStream = “”; var bufOutStream = “”; var nm = “”; var pth = “”; var lenPth = “”; var buffer = “”; var l = 0; zipFile = createObject(“java”, “java.util.zip.ZipFile”); zipFile.init(zipFilePath); entries = zipFile.entries(); while(entries.hasMoreElements()) { entry = entries.nextElement(); if(NOT entry.isDirectory()) { nm = entry.getName(); lenPth = len(nm) – len(getFileFromPath(nm)); if (lenPth) { pth = outputPath & left(nm, lenPth); } else { pth = outputPath; } if (NOT directoryExists(pth)) { fil = createObject(“java”, “java.io.File”); fil.init(pth); fil.mkdirs(); } filOutStream = createObject(“java”, “java.io.FileOutputStream”); filOutStream.init(outputPath & nm); bufOutStream = createObject( “java”, “java.io.BufferedOutputStream”); bufOutStream.init(filOutStream); inStream = zipFile.getInputStream(entry); buffer = repeatString(” “,1024).getBytes(); l = inStream.read(buffer); while(l GTE 0) { bufOutStream.write(buffer, 0, l); l = inStream.read(buffer); } inStream.close(); bufOutStream.close(); } } zipFile.close();”

1 Comment
2024-09-24 02:32:15
2024-09-24 02:32:15

That “strange text” is cfml code. My guess is that you’re page in question is doing a cfinclude of the file with that code. And the “change” would likely be about your cf admin “settings” page. See the setting for file extensions allowed to be included.

Add the one for the file holding the code you are seeing. Let us know if that solves it. 

Like
Add Comment