Changeset 994
- Timestamp:
- 06/04/07 18:47:47 (1 year ago)
- Files:
-
- trunk/xmlrpc.php (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/xmlrpc.php
r991 r994 19 19 20 20 if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd 21 header('Content- type: text/xml; charset=' . get_option('blog_charset'), true);21 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); 22 22 23 23 ?> … … 29 29 <homePageLink><?php bloginfo_rss('url') ?></homePageLink> 30 30 <apis> 31 <api name="WordPress" blogID="1" preferred="false" apiLink="<?php bloginfo_rss(' url') ?>/xmlrpc.php" />32 <api name="Movable Type" blogID="1" preferred="true" apiLink="<?php bloginfo_rss(' url') ?>/xmlrpc.php" />33 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php bloginfo_rss(' url') ?>/xmlrpc.php" />34 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php bloginfo_rss(' url') ?>/xmlrpc.php" />31 <api name="WordPress" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 32 <api name="Movable Type" blogID="1" preferred="true" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 33 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 34 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 35 35 </apis> 36 36 </service> … … 209 209 210 210 // Format page date. 211 $page_date = mysql2date("Ymd\TH:i:s ", $page->post_date_gmt);211 $page_date = mysql2date("Ymd\TH:i:s\Z", $page->post_date_gmt); 212 212 213 213 // Pull the categories info together. … … 439 439 $num_pages = count($page_list); 440 440 for($i = 0; $i < $num_pages; $i++) { 441 $post_date = mysql2date("Ymd\TH:i:s ", $page_list[$i]->post_date_gmt);441 $post_date = mysql2date("Ymd\TH:i:s\Z", $page_list[$i]->post_date_gmt); 442 442 $page_list[$i]->dateCreated = new IXR_Date($post_date); 443 443 … … 539 539 $password = $args[2]; 540 540 $category = $args[3]; 541 $max_results = $args[4];541 $max_results = (int) $args[4]; 542 542 543 543 if(!$this->login_pass_ok($username, $password)) { … … 943 943 } 944 944 945 $cap = ($publish) ? 'publish_posts' : 'edit_posts'; 945 946 $user = set_current_user(0, $user_login); 946 if ( !current_user_can( 'publish_posts') )947 if ( !current_user_can($cap) ) 947 948 return new IXR_Error(401, __('Sorry, you can not post on this weblog or category.')); 948 949 … … 988 989 case "post": 989 990 if(!current_user_can("edit_others_posts")) { 990 return(new IXR_Error(401, "You are not allowed to " . 991 "post as this user")); 991 return(new IXR_Error(401, __("You are not allowed to post as this user"))); 992 992 } 993 993 break; 994 994 case "page": 995 995 if(!current_user_can("edit_others_pages")) { 996 return(new IXR_Error(401, "You are not allowed to " . 997 "create pages as this user")); 996 return(new IXR_Error(401, __("You are not allowed to create pages as this user"))); 998 997 } 999 998 break; … … 1164 1163 } 1165 1164 1166 $post_author = $ user->ID;1165 $post_author = $postdata["post_author"]; 1167 1166 1168 1167 // Only set the post_author if one is set. … … 1174 1173 case "post": 1175 1174 if(!current_user_can("edit_others_posts")) { 1176 return(new IXR_Error(401, "You are not allowed to " . 1177 "change the post author as this user.")); 1175 return(new IXR_Error(401, __("You are not allowed to change the post author as this user."))); 1178 1176 } 1179 1177 break; 1180 1178 case "page": 1181 1179 if(!current_user_can("edit_others_pages")) { 1182 return(new IXR_Error(401, "You are not allowed to " . 1183 "change the page author as this user.")); 1180 return(new IXR_Error(401, __("You are not allowed to change the page author as this user."))); 1184 1181 } 1185 1182 break; … … 1283 1280 if ($postdata['post_date'] != '') { 1284 1281 1285 $post_date = mysql2date('Ymd\TH:i:s ', $postdata['post_date_gmt']);1282 $post_date = mysql2date('Ymd\TH:i:s\Z', $postdata['post_date_gmt']); 1286 1283 1287 1284 $categories = array(); … … 1351 1348 foreach ($posts_list as $entry) { 1352 1349 1353 $post_date = mysql2date('Ymd\TH:i:s ', $entry['post_date_gmt']);1350 $post_date = mysql2date('Ymd\TH:i:s\Z', $entry['post_date_gmt']); 1354 1351 $categories = array(); 1355 1352 $catids = wp_get_post_categories($entry['ID']); … … 1485 1482 $upload = wp_upload_bits($name, $type, $bits, $overwrite); 1486 1483 if ( ! empty($upload['error']) ) { 1487 $errorString = 'Could not write file ' . $name . ' (' . $upload['error'] . ')';1484 $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']); 1488 1485 logIO('O', '(MW) ' . $errorString); 1489 1486 return new IXR_Error(500, $errorString); … … 1536 1533 foreach ($posts_list as $entry) { 1537 1534 1538 $post_date = mysql2date('Ymd\TH:i:s ', $entry['post_date_gmt']);1535 $post_date = mysql2date('Ymd\TH:i:s\Z', $entry['post_date_gmt']); 1539 1536 1540 1537 $struct[] = array( … … 1796 1793 } else { 1797 1794 // TODO: Attempt to extract a post ID from the given URL 1798 return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');1795 return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); 1799 1796 } 1800 1797 $post_ID = (int) $post_ID; … … 1806 1803 1807 1804 if ( !$post ) // Post_ID not found 1808 return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');1805 return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); 1809 1806 1810 1807 if ( $post_ID == url_to_postid($pagelinkedfrom) ) … … 1813 1810 // Check if pings are on 1814 1811 if ( 'closed' == $post->ping_status ) 1815 return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');1812 return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); 1816 1813 1817 1814 // Let's check that the remote site didn't already pingback this entry … … 1895 1892 do_action('pingback_post', $comment_ID); 1896 1893 1897 return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";1894 return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto); 1898 1895 } 1899 1896 … … 1913 1910 if (!$post_ID) { 1914 1911 // We aren't sure that the resource is available and/or pingback enabled 1915 return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');1912 return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); 1916 1913 } 1917 1914
