mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
get_comments() can return int, so a few places need to check if the return value is traversable before passing what is assumed to be an array.
See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32600 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3196,12 +3196,13 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
if ( isset($struct['number']) )
|
||||
$number = absint($struct['number']);
|
||||
|
||||
$comments = get_comments( array('status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) );
|
||||
$comments = get_comments( array( 'status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) );
|
||||
|
||||
$comments_struct = array();
|
||||
|
||||
foreach ( $comments as $comment ) {
|
||||
$comments_struct[] = $this->_prepare_comment( $comment );
|
||||
if ( is_array( $comments ) ) {
|
||||
foreach ( $comments as $comment ) {
|
||||
$comments_struct[] = $this->_prepare_comment( $comment );
|
||||
}
|
||||
}
|
||||
|
||||
return $comments_struct;
|
||||
|
||||
Reference in New Issue
Block a user