Opened 14 years ago
Closed 11 years ago
#21249 closed defect (bug) (fixed)
WP_List_Table::single_row_columns() needs to do an exact comparison
| Reported by: | Viper007Bond | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: | Focuses: |
Description
If for whatever reason you pass a column ID of 0 when dealing with a list table, WordPress thinks it's a checkbox column because of the loose comparison, i.e. == instead of ===.
Since I don't see why passing a number instead of a string shouldn'r be allowed, attached is a patch.
Attachments (1)
Change History (10)
#2
@
14 years ago
- Keywords reporter-feedback removed
D'oh. Yes, it does. Seems PHP's type coercion is at least as treacherous as the one in JavaScript.
#3
@
14 years ago
- Cc added
- Keywords needs-testing removed
- Milestone Awaiting Review → 3.4.3
I can reproduce the original bug. The patch looks good.
#4
@
14 years ago
- Milestone 3.4.3 → 3.5
Would if ( 'cb' == $column_key ) in print_column_headers() also be affected?
#5
@
14 years ago
Seems like it would be affected, yes.
I can't test though because I don't remember exactly what I was working on at the time other than maybe I was creating columns programically using a numeric array.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Are you saying
'cb' == 0evals to true?