[wp-trac] [WordPress Trac] #29467: is_object_in_term() return true If the term name begins with a number

WordPress Trac noreply at wordpress.org
Tue Sep 2 12:21:15 UTC 2014


#29467: is_object_in_term() return true If the term name begins with a number
--------------------------+-----------------------------
 Reporter:  nobinobi      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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;
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29467>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list