Opened 12 years ago
Closed 12 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.1 |
| Component: | Taxonomy | Version: | 2.7 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
12 years ago
- Resolution → worksforme
- Status new → closed
The function filters the integers and compares them before the mentioned line will be executed.
#5
@
12 years ago
- Keywords has-patch needs-testing added
- Resolution worksforme
- Status closed → 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
@
12 years ago
@DrewAPicture Oh, sorry for that. Seems I should read the contributors handbook more accurately. ;)
Anyway I could not reproduce this problem.
#7
@
12 years ago
- Keywords needs-unit-tests has-patch needs-testing removed
- Milestone Awaiting Review → 4.1
- Owner set to
- Status reopened → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #24674