Ticket #7772: 7772.2.diff
File 7772.2.diff, 1.0 KB (added by , 17 years ago) |
---|
-
xmlrpc.php
2523 2523 if( $postdata['post_status'] === 'future' ) { 2524 2524 $postdata['post_status'] = 'publish'; 2525 2525 } 2526 2527 $enclosure = array(); 2528 foreach ( (array) get_post_custom($post_ID) as $key => $val) { 2529 if ($key == 'enclosure') { 2530 foreach ( (array) $val as $enc ) { 2531 $encdata = split("\n", $enc); 2532 $enclosure['url'] = trim(htmlspecialchars($encdata[0])); 2533 $enclosure['length'] = trim($encdata[1]); 2534 $enclosure['type'] = trim($encdata[2]); 2535 break 2; 2536 } 2537 } 2538 } 2526 2539 2527 2540 $resp = array( 2528 2541 'dateCreated' => new IXR_Date($post_date), … … 2548 2561 'post_status' => $postdata['post_status'], 2549 2562 'custom_fields' => $this->get_custom_fields($post_ID) 2550 2563 ); 2551 2564 2565 if (!empty($enclosure)) $resp['enclosure'] = $enclosure; 2566 2552 2567 return $resp; 2553 2568 } else { 2554 2569 return new IXR_Error(404, __('Sorry, no such post.'));