--- xmlrpc2.php	2007-12-09 11:26:16.109375000 +1100
+++ xmlrpc.php	2007-12-09 11:23:59.281250000 +1100
@@ -459,7 +459,6 @@
 * wp_getAuthors
 */
 function wp_getAuthors($args) {
-global $wpdb;
 
 $this->escape($args);
 
@@ -533,8 +532,6 @@
 * wp_suggestCategories
 */
 function wp_suggestCategories($args) {
-global $wpdb;
-
 $this->escape($args);
 
 $blog_id				= (int) $args[0];
@@ -625,7 +622,6 @@
 return $this->error;
 }
 
-$user_data = get_userdatabylogin($user_login);
 $post_data = wp_get_single_post($post_ID, ARRAY_A);
 
 $categories = implode(',', wp_get_post_categories($post_ID));
@@ -648,8 +644,6 @@
 /* blogger.getRecentPosts ...gets recent posts */
 function blogger_getRecentPosts($args) {
 
-global $wpdb;
-
 $this->escape($args);
 
 $blog_ID    = (int) $args[1]; /* though we don't use it yet */
@@ -767,8 +761,6 @@
 /* blogger.newPost ...creates a new post */
 function blogger_newPost($args) {
 
-global $wpdb;
-
 $this->escape($args);
 
 $blog_ID    = (int) $args[1]; /* though we don't use it yet */
@@ -803,9 +795,9 @@
 if ( is_wp_error( $post_ID ) )
 return new IXR_Error(500, $post_ID->get_error_message());
 
-if (!$post_ID) {
+if (!$post_ID)
 return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.'));
-}
+
 $this->attach_uploads( $post_ID, $post_content );
 
 logIO('O', "Posted ! ID: $post_ID");
@@ -813,12 +805,9 @@
 return $post_ID;
 }
 
-
 /* blogger.editPost ...edits a post */
 function blogger_editPost($args) {
 
-global $wpdb;
-
 $this->escape($args);
 
 $post_ID     = (int) $args[1];
@@ -867,9 +856,6 @@
 
 /* blogger.deletePost ...deletes a post */
 function blogger_deletePost($args) {
-
-global $wpdb;
-
 $this->escape($args);
 
 $post_ID     = (int) $args[1];
@@ -908,9 +894,6 @@
 
 /* metaweblog.newPost creates a post */
 function mw_newPost($args) {
-
-global $wpdb, $post_default_category;
-
 $this->escape($args);
 
 $blog_ID     = (int) $args[0]; // we will support this in the near future
@@ -1122,8 +1105,6 @@
 /* metaweblog.editPost ...edits a post */
 function mw_editPost($args) {
 
-global $wpdb, $post_default_category;
-
 $this->escape($args);
 
 $post_ID     = (int) $args[0];
@@ -1330,8 +1311,6 @@
 /* metaweblog.getPost ...returns a post */
 function mw_getPost($args) {
 
-global $wpdb;
-
 $this->escape($args);
 
 $post_ID     = (int) $args[0];
@@ -1345,22 +1324,19 @@
 $postdata = wp_get_single_post($post_ID, ARRAY_A);
 
 if ($postdata['post_date'] != '') {
-
 $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']);
 $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']);
 
 $categories = array();
 $catids = wp_get_post_categories($post_ID);
-foreach($catids as $catid) {
+foreach($catids as $catid)
 $categories[] = get_cat_name($catid);
-}
 
 $tagnames = array();
 $tags = wp_get_post_tags( $post_ID );
 if ( !empty( $tags ) ) {
-foreach ( $tags as $tag ) {
+foreach ( $tags as $tag )
 $tagnames[] = $tag->name;
-}
 $tagnames = implode( ', ', $tagnames );
 } else {
 $tagnames = '';
@@ -1496,8 +1472,6 @@
 /* metaweblog.getCategories ...returns the list of categories on a given blog */
 function mw_getCategories($args) {
 
-global $wpdb;
-
 $this->escape($args);
 
 $blog_ID     = (int) $args[0];
@@ -1576,7 +1550,7 @@
 $name = "wpid{$old_file->ID}-{$filename}";
 }
 
-$upload = wp_upload_bits($name, $type, $bits, $overwrite);
+$upload = wp_upload_bits($name, $type, $bits);
 if ( ! empty($upload['error']) ) {
 $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);
 logIO('O', '(MW) ' . $errorString);
@@ -1654,8 +1628,6 @@
 /* mt.getCategoryList ...returns the list of categories on a given blog */
 function mt_getCategoryList($args) {
 
-global $wpdb;
-
 $this->escape($args);
 
 $blog_ID     = (int) $args[0];
@@ -1834,7 +1806,7 @@
 
 /* pingback.ping gets a pingback and registers it */
 function pingback_ping($args) {
-global $wpdb, $wp_version;
+global $wpdb;
 
 $this->escape($args);
 
@@ -1847,8 +1819,6 @@
 $pagelinkedto = str_replace('&amp;', '&', $pagelinkedto);
 $pagelinkedto = str_replace('&', '&amp;', $pagelinkedto);
 
-$error_code = -1;
-
 // Check if the page linked to is in our site
 $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_option('home')));
 if( !$pos1 )
@@ -1912,7 +1882,7 @@
 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.'));
 
 // Let's check that the remote site didn't already pingback this entry
-$result = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post_ID' AND comment_author_url = '$pagelinkedfrom'");
+$wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post_ID' AND comment_author_url = '$pagelinkedfrom'");
 
 if ( $wpdb->num_rows ) // We already have a Pingback from this URL
 return new IXR_Error(48, __('The pingback has already been registered.'));
@@ -1974,9 +1944,7 @@
 $pagelinkedfrom = str_replace('&', '&amp;', $pagelinkedfrom);
 
 $context = '[...] ' . wp_specialchars( $excerpt ) . ' [...]';
-$original_pagelinkedfrom = $pagelinkedfrom;
 $pagelinkedfrom = $wpdb->escape( $pagelinkedfrom );
-$original_title = $title;
 
 $comment_post_ID = (int) $post_ID;
 $comment_author = $title;

