mantisbt/mantisbt — comment on commit 9fbbd86e5f4087d062a15cda07726bc924bc6ec6
File:  line 0
By dregad:

@davidhicks could you please comment on the rationale behind this change, and what behavior you intended to correct ?

I implemented a fix for #13937 to properly pre-select multiple values in filter selection lists for versions and categories, and this commit actually introduces a regression:

* option "[any]" ($p_val=0) is *always* selected when one of values to pre-select ($t_this_var) is a string

This is due to the condition you modified evaluating to *false* in this case, so the code goes to the else if which is *true* since the string value is converted to int(0) == 0

I believe the purpose of the type-safe comparison you labeled as "incorrect logic", was actually to cover this special case, as mentioned in the comment. If this assumption is correct, then I think your commit should be reverted.

Let me know your thoughts.