Opened 8 years ago
Closed 8 years ago
#37746 closed defect (bug) (fixed)
Replace `absint( $meta_id)` check in `delete_metadata_by_mid`, etc
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Options, Meta APIs | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
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_mid
get_metadata_by_mid
This will affect the related functions for particular meta types.
Attachments (2)
Change History (7)
#1
@
8 years ago
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
- Version set to 4.0
#3
@
8 years ago
- Milestone changed from Awaiting Review to 4.7
Milestoning this to join the related tickets mentioned above.
#4
@
8 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.
In 37746.diff:
absint
withintval
$meta_id
is zero or lower.