@@ -5,7 +5,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="ajax,form,url" {
55 }
66
77 function run ( testResults , testBox ) {
8- describe ( " LDEV-6070: Support bracket notation in form/URL parameters" , function () {
8+ describe ( " Bracket notation in form/URL parameters" , function () {
99
1010 it ( " should parse simple bracket notation into nested struct" , function () {
1111 var result = _internalRequest (
@@ -201,6 +201,65 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="ajax,form,url" {
201201 });
202202
203203 });
204+
205+ describe ( " Array notation with [] suffix (existing functionality)" , function () {
206+
207+ it ( " should handle tags[] with struct format (array value)" , function () {
208+ var result = _internalRequest (
209+ template : " #uri #/test.cfm" ,
210+ forms : {
211+ " tags[]" : [ " java" , " cfml" , " lucee" ]
212+ }
213+ );
214+ expect ( result .filecontent ).toInclude ( " tags=java,cfml,lucee" );
215+ });
216+
217+ it ( " should handle tags[] with query string format (multiple params)" , function () {
218+ var result = _internalRequest (
219+ template : " #uri #/test.cfm" ,
220+ forms : " tags[]=java&tags[]=cfml&tags[]=lucee"
221+ );
222+ expect ( result .filecontent ).toInclude ( " tags=java,cfml,lucee" );
223+ });
224+
225+ it ( " should handle single value with tags[]" , function () {
226+ var result = _internalRequest (
227+ template : " #uri #/test.cfm" ,
228+ forms : " tags[]=lucee"
229+ );
230+ expect ( result .filecontent ).toInclude ( " tags=lucee" );
231+ });
232+
233+ it ( " should handle nested array notation user[tags][]" , function () {
234+ var result = _internalRequest (
235+ template : " #uri #/test.cfm" ,
236+ forms : " user[tags][]=foo&user[tags][]=bar"
237+ );
238+ expect ( result .filecontent ).toInclude ( " user.tags=foo,bar" );
239+ });
240+
241+ it ( " should handle deeply nested array notation user[prefs][tags][]" , function () {
242+ var result = _internalRequest (
243+ template : " #uri #/test.cfm" ,
244+ forms : " user[prefs][tags][]=foo&user[prefs][tags][]=bar"
245+ );
246+ expect ( result .filecontent ).toInclude ( " user.prefs.tags=foo,bar" );
247+ });
248+
249+ });
250+
251+ describe ( " Original reported issue from forum" , function () {
252+
253+ it ( " should handle userData[name] and userData[sellerID] from jQuery post" , function () {
254+ var result = _internalRequest (
255+ template : " #uri #/test.cfm" ,
256+ forms : " userData[name]=John&userData[sellerID]=12345"
257+ );
258+ expect ( result .filecontent ).toInclude ( " userData.name=John" );
259+ expect ( result .filecontent ).toInclude ( " userData.sellerID=12345" );
260+ });
261+
262+ });
204263 }
205264
206265 private string function createURI ( string calledName ) {
0 commit comments