View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0020476 | mantisbt | code cleanup | public | 2016-01-04 19:48 | 2016-06-12 00:43 |
Reporter | cproensa | Assigned To | cproensa | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 1.3.0-rc.2 | Fixed in Version | 1.3.0-rc.2 | ||
Summary | 0020476: gpc_get_int_array does not work for associative arrays | ||||
Description | using "gpc_get_int_array()" over field named with explicit index does not return the correct array, as indexes are converted to numeric. Example: gpc_get_int_array() returns: The same problem happens with "gpc_get_bool_array()" | ||||
Tags | No tags attached. | ||||
@cproensa, what is the bug that you are trying to fix here? Is there a functionality / feature that is broken that this change will fix? If so, we should lead with that and then explain the root cause being the issue with these functions. This way, users reading the changelog would understand the changes and how it affects them. If it is purely a code cleanup change, then we should be using the code cleanup category. I looked at the change, and it is fine otherwise. Thanks. |
|
It's not a bug that affects the current core because all HTML forms uses array fields without a given index. However, when using the pattern: input name="foo[N]" Please change category as needed. As you said, there's not a bug currently caused by this. Its a potential for future bugs and for plugin developers, though. |
|
Changed category to 'code cleanup' as per vboctor's suggestion, also cleared product version as the 0-based logic has been there for ages. |
|
thanks! |
|
MantisBT: master b53f7caa 2016-01-04 14:31 Committer: dregad Details Diff |
Fix gpc_get_xxx_array for associative arrays Functions: - gpc_get_int_array(), - gpc_get_bool_array() dont work properly for html fields named with associative indexes (numeric out or order, or strings), because it assumes indexes as zero-based sequential numbers. The code is changed to keep the original keys as defined in the field names. This is not an issue in MantisBT core, but may affects plugins. Fixes 0020476 Signed-off-by: Damien Regad <dregad@mantisbt.org> |
Affected Issues 0020476 |
|
mod - core/gpc_api.php | Diff File | ||
MantisBT: master 2ed3c644 2016-01-06 03:04 Committer: dregad Details Diff |
Fix gpc_get regression This fixes a regression introduced by commit b53f7caace3513d544149a18beb8f1e422e9a96e. When loop is changed into 'foreach', null values produce error if not checked. Issue 0020476 Signed-off-by: Damien Regad <dregad@mantisbt.org> |
Affected Issues 0020476 |
|
mod - core/gpc_api.php | Diff File |