make xmlrpc_getpostcategory support multiple, comma-separated categories

git-svn-id: http://svn.automattic.com/wordpress/trunk@1347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
michelvaldrighi 2004-05-23 02:55:10 +00:00
parent 3c2c7625e9
commit be22bea57d
1 changed files with 2 additions and 4 deletions

View File

@ -629,10 +629,8 @@ function xmlrpc_getposttitle($content) {
function xmlrpc_getpostcategory($content) {
global $post_default_category;
if (preg_match('/<category>(.+?)<\/category>/is', $content, $matchcat)) {
$post_category = $matchcat[0];
$post_category = preg_replace('/<category>/si', '', $post_category);
$post_category = preg_replace('/<\/category>/si', '', $post_category);
$post_category = trim($matchcat[1], ',');
$post_category = explode(',', $post_category);
} else {
$post_category = $post_default_category;
}