﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
23201,post-template.php calls in_array() without checking args,gcrumb,,"Line 1039 of wp-includes/post-template looks like:


{{{
if ( in_array( $page->ID, $_current_page->ancestors ) )
}}}

... but in some circumstances, $_current_page->ancestors is null, which results in an error being thrown. I suggest testing the variable before passing it:

{{{
if ( gettype($_current_page->ancestors) === 'array' && in_array( $page->ID, $_current_page->ancestors ) )
}}}

",defect (bug),closed,normal,,Template,,normal,duplicate,reporter-feedback,kovshenin
