Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ColdFusion 10 form variable functionality change relating to case of variables

We're just looking at porting a legacy script to ColdFusion 10 and I believe I have come across a bug/change in functionality relating to the use of multiple form fields using the same name. In ColdFusion 9 these would have been appended to the relevant variable with commas, but in ColdFusion 10, if the case of the variables is different one field will overwrite the other.

The following test code:

<form action="index2.cfm" method="post">
    <input type="hidden" name="test" value="1" />
    <input type="hidden" name="TEST" value="0" />
    <input type="submit" />
</form>

<cfdump var="#form#">

Produces on ColdFusion 9

TEST = 1,0

On ColdFusion 10:

TEST = 0

Has anyone else experienced this behaviour and knows whether it is a bug or intended functionality? I know the application shouldn't be using the same variable name in different cases, so will look at changing this, but just wondered if anyone had any more information on the issue.

Edit

I have submitted this bug to Adobe at https://bugbase.adobe.com/index.cfm?event=bug&id=3298179

like image 286
Loftx Avatar asked Jul 27 '12 11:07

Loftx


People also ask

Are ColdFusion variables case sensitive?

ColdFusion variables are not case sensitive. However, consistent capitalization makes the code easier to read.

How do you check variable type in ColdFusion?

CFML is dynamically typed, so types can change as required. You can see the current (JVM) type of a variable by doing <cfdump var=#getMetadata(var)# /> or simply by accessing getMetadata(var). getName() .

What is Cfparam in ColdFusion?

Tests for a parameter's existence, tests its data type, and, if. a default value is not assigned, optionally provides one.


2 Answers

@Russ

This feature is indeed just that a feature. I believe you've missed the point in the above post that specifying the same field name with different case no longer passes a list result.

One of the main things I and many have used this functionality for in the past is checkboxes. A group can have the same name so that your validation is easy yet different values so CF can process which ones have been ticked before form submission(obviously unticked items aren't passed into the list).

like image 57
wade montague Avatar answered Sep 22 '22 04:09

wade montague


This bug appears to have been confirmed by Adobe in as Bug #3298179. It is reported as fixed in build 283412 and currently in the testing phase. I will update this answer with the relevent hotfix information once this has been released publicly.

like image 45
Loftx Avatar answered Sep 19 '22 04:09

Loftx