WordPress.org

Make WordPress Core

Ticket #3388: patch.txt

File patch.txt, 1.1 KB (added by donncha, 7 years ago)
Line 
1Index: xmlrpc.php
2===================================================================
3--- xmlrpc.php  (revision 4524)
4+++ xmlrpc.php  (working copy)
5@@ -833,13 +833,15 @@
6                        return $this->error;
7                }
8 
9+               if ( $upload_err = apply_filters( "pre_upload_error", false ) )
10+                       return new IXR_Error(500, $upload_err);
11+
12                $upload = wp_upload_bits($name, $type, $bits);
13                if ( ! empty($upload['error']) ) {
14                        logIO('O', '(MW) Could not write file '.$name);
15                        return new IXR_Error(500, 'Could not write file '.$name);
16                }
17-
18-               return array('url' => $upload['url']);
19+               return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) );
20        }
21 
22 
23@@ -1215,8 +1217,8 @@
24 
25                $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type');
26 
27-               wp_new_comment($commentdata);
28-               do_action('pingback_post', $wpdb->insert_id);
29+               $comment_ID = wp_new_comment($commentdata);
30+               do_action('pingback_post', $comment_ID);
31 
32                return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";
33        }