Commit 5f9bea26 authored by Dries's avatar Dries
Browse files

- Patch #10115 by James: bugfixes:

   + If an array of tb urls is given for mt_tb_ping_urls, the last url actually gets pinged twice.
   + mt_allow_comments and mt_convert_breaks were not being sent properly in the xmlrpc response for getPost.
parent 451821ab
...@@ -603,6 +603,7 @@ function _blogapi_mt_extra(&$node, $struct) { ...@@ -603,6 +603,7 @@ function _blogapi_mt_extra(&$node, $struct) {
foreach ($struct['mt_tb_ping_urls'] as $tb_ping_url) { foreach ($struct['mt_tb_ping_urls'] as $tb_ping_url) {
$node->tb_url = $tb_ping_url->getVal(); $node->tb_url = $tb_ping_url->getVal();
trackback_send($node); trackback_send($node);
unset($node->tb_url); // make sure we don't ping twice
} }
} }
else { else {
...@@ -645,8 +646,8 @@ function _blogapi_get_post($node, $bodies = true) { ...@@ -645,8 +646,8 @@ function _blogapi_get_post($node, $bodies = true) {
$xmlrpcval['content'] = new xmlrpcval("<title>$blog->title</title>$node->body", 'string'); $xmlrpcval['content'] = new xmlrpcval("<title>$blog->title</title>$node->body", 'string');
$xmlrpcval['description'] = new xmlrpcval($node->body, 'string'); $xmlrpcval['description'] = new xmlrpcval($node->body, 'string');
// Add MT specific fields // Add MT specific fields
$xmlrpcval['mt_allow_comments'] = $comment; $xmlrpcval['mt_allow_comments'] = new xmlrpcval($comment, 'string');
$xmlrpcval['mt_convert_breaks'] = $node->format; $xmlrpcval['mt_convert_breaks'] = new xmlrpcval($node->format, 'string');
} }
return new xmlrpcval($xmlrpcval, 'struct'); return new xmlrpcval($xmlrpcval, 'struct');
......
...@@ -603,6 +603,7 @@ function _blogapi_mt_extra(&$node, $struct) { ...@@ -603,6 +603,7 @@ function _blogapi_mt_extra(&$node, $struct) {
foreach ($struct['mt_tb_ping_urls'] as $tb_ping_url) { foreach ($struct['mt_tb_ping_urls'] as $tb_ping_url) {
$node->tb_url = $tb_ping_url->getVal(); $node->tb_url = $tb_ping_url->getVal();
trackback_send($node); trackback_send($node);
unset($node->tb_url); // make sure we don't ping twice
} }
} }
else { else {
...@@ -645,8 +646,8 @@ function _blogapi_get_post($node, $bodies = true) { ...@@ -645,8 +646,8 @@ function _blogapi_get_post($node, $bodies = true) {
$xmlrpcval['content'] = new xmlrpcval("<title>$blog->title</title>$node->body", 'string'); $xmlrpcval['content'] = new xmlrpcval("<title>$blog->title</title>$node->body", 'string');
$xmlrpcval['description'] = new xmlrpcval($node->body, 'string'); $xmlrpcval['description'] = new xmlrpcval($node->body, 'string');
// Add MT specific fields // Add MT specific fields
$xmlrpcval['mt_allow_comments'] = $comment; $xmlrpcval['mt_allow_comments'] = new xmlrpcval($comment, 'string');
$xmlrpcval['mt_convert_breaks'] = $node->format; $xmlrpcval['mt_convert_breaks'] = new xmlrpcval($node->format, 'string');
} }
return new xmlrpcval($xmlrpcval, 'struct'); return new xmlrpcval($xmlrpcval, 'struct');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment