From 6ff955829cac7ba5e239f43e4d1a7d6850614307 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 2 Mar 2005 15:38:09 +0000 Subject: [PATCH] Make sure category list is actually a list. http://mosquito.wordpress.org/view.php?id=988 git-svn-id: http://svn.automattic.com/wordpress/trunk@2399 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- xmlrpc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmlrpc.php b/xmlrpc.php index dbea05e8de..058062f595 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -523,7 +523,7 @@ class wp_xmlrpc_server extends IXR_Server { logIO('O', 'Post cats: ' . printr($catnames,true)); $post_category = array(); - if ($catnames) { + if (is_array($catnames)) { foreach ($catnames as $cat) { $post_category[] = get_cat_ID($cat); } @@ -576,10 +576,12 @@ class wp_xmlrpc_server extends IXR_Server { $post_content = apply_filters( 'content_save_pre', $content_struct['description'] ); $catnames = $content_struct['categories']; - if ($catnames) { + if (is_array($catnames)) { foreach ($catnames as $cat) { $post_category[] = get_cat_ID($cat); } + } else { + $post_category[] = 1; } $post_excerpt = $content_struct['mt_excerpt'];