Ticket #28601: class-wp-xmlrpc-server.php.patch
File class-wp-xmlrpc-server.php.patch, 1.6 KB (added by , 11 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
1101 1101 if ( ! $user = $this->login( $username, $password ) ) 1102 1102 return $this->error; 1103 1103 1104 // convert the date field back to IXR form 1105 if ( isset( $content_struct['post_date'] ) ) { 1106 $content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] ); 1107 } 1108 1109 // ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct, 1110 // since _insert_post will ignore the non-GMT date if the GMT date is set 1111 if ( isset( $content_struct['post_date_gmt'] ) ) { 1112 if ( $content_struct['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) ) { 1113 unset( $content_struct['post_date_gmt'] ); 1114 } else { 1115 $content_struct['post_date_gmt'] = $this->_convert_date( $content_struct['post_date_gmt'] ); 1116 } 1117 } 1118 1104 1119 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 1105 1120 do_action( 'xmlrpc_call', 'wp.newPost' ); 1106 1121 … … 1193 1208 1194 1209 if ( isset( $post_data['ping_status'] ) && $post_data['ping_status'] != 'open' && $post_data['ping_status'] != 'closed' ) 1195 1210 unset( $post_data['ping_status'] ); 1211 // Do some timestamp voodoo 1196 1212 1197 // Do some timestamp voodoo1198 1213 if ( ! empty( $post_data['post_date_gmt'] ) ) { 1199 1214 // We know this is supposed to be GMT, so we're going to slap that Z on there by force 1200 1215 $dateCreated = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';