Opened 10 years ago
Closed 10 years ago
#29467 closed defect (bug) (fixed)
is_object_in_term() return true If the term name begins with a number
Reported by: | nobinobi | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
If the term name begins with a number Might return true even if the post not belongs to a taxonomy term
this code return true
$object_term->term_id = 10; $strs = array("10_term_name"); if ( in_array( $object_term->term_id, $strs ) ) return true;
change to
if ( in_array( $object_term->term_id, $strs , true ) ) return true;
Attachments (2)
Change History (11)
#4
@
10 years ago
- Resolution set to worksforme
- Status changed from new to closed
The function filters the integers and compares them before the mentioned line will be executed.
#5
@
10 years ago
- Keywords has-patch needs-testing added
- Resolution worksforme deleted
- Status changed from closed to reopened
We only use worksforme
when we can't reproduce a bug, it doesn't have anything to do with the patch/unit tests workflow. Reopening :)
#6
@
10 years ago
@DrewAPicture Oh, sorry for that. Seems I should read the contributors handbook more accurately. ;)
Anyway I could not reproduce this problem.
#7
@
10 years ago
- Keywords needs-unit-tests has-patch needs-testing removed
- Milestone changed from Awaiting Review to 4.1
- Owner set to boonebgorges
- Status changed from reopened to accepted
nobinobi - Thanks for the report and the suggested fix.
realloc - Thanks for writing up the unit test. It's almost right: the issue that nobinobi only arises if you concatenate a term string *that begins with the ID of a term that the post belongs to*, not the ID of the post itself.
Related: #24674