Opened 10 years ago
Closed 10 years ago
#37746 closed defect (bug) (fixed)
Replace `absint( $meta_id)` check in `delete_metadata_by_mid`, etc
| Reported by: | peterwilsoncc | Owned by: | peterwilsoncc |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.7 |
| Component: | Options, Meta APIs | Version: | 4.0 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Absint is run on the meta ID when deleting meta data, so calling delete_metadata_by_mid( 'user', -10 ) actually results in delete_metadata_by_mid( 'user', 10 ).
This is close but not close enough, instead the function can check it's a positive integer and fail if not.
Same applies to:
update_metadata_by_midget_metadata_by_mid
This will affect the related functions for particular meta types.
Attachments (2)
Change History (7)
#1
@
10 years ago
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
- Version → 4.0
#3
@
10 years ago
- Milestone Awaiting Review → 4.7
Milestoning this to join the related tickets mentioned above.
#4
@
10 years ago
In 37746.2.diff:
- fail on negative numbers
- fail on floats
get_metadata_by_mid( "1.0" )is accepted
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 37746.diff:
absintwithintval$meta_idis zero or lower.