cfswitch tag not working the same as cfscript switch

Description

Additionally, I would assume that this code below should also work ( currently throws an exception!! )

 

Environment

None

Attachments

3

Activity

Pothys - MitrahSoft 23 January 2025 at 14:42

I have been running this code, and it gives different output, and it seems to be a bug. but the ACF also gives the same result

Arthur 27 February 2020 at 14:00
Edited

the switch() must evaluate to true or 1 otherwise its pointless. The idea is that the regex will return true or false. In this particular case the regex returns the position which is 1, so true also works

But generally speaking if the regex is written differently the switch statement must react to true value only

if that makes sense.

Zac Spitzer 27 February 2020 at 13:50

Arthur 27 February 2020 at 13:25

 

Zac Spitzer 27 February 2020 at 13:19

can you post the source as a trycf gist?

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 26 February 2020 at 20:35
Updated 23 January 2025 at 14:47
Resolved 23 January 2025 at 14:34