Changeset 36661
- Timestamp:
- 02/24/2016 12:55:01 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r36163 r36661 6278 6278 ), 6279 6279 ); 6280 6280 6281 $request = wp_safe_remote_get( $pagelinkedfrom, $http_api_args ); 6281 $ linea= wp_remote_retrieve_body( $request );6282 6283 if ( ! $linea )6282 $remote_source = $remote_source_original = wp_remote_retrieve_body( $request ); 6283 6284 if ( ! $remote_source ) { 6284 6285 return $this->pingback_error( 16, __( 'The source URL does not exist.' ) ); 6286 } 6285 6287 6286 6288 /** … … 6289 6291 * @since 2.5.0 6290 6292 * 6291 * @param string $ linea Response objectfor the page linked from.6292 * @param string $pagelinkedto URL of the page linked to.6293 * @param string $remote_source Response source for the page linked from. 6294 * @param string $pagelinkedto URL of the page linked to. 6293 6295 */ 6294 $ linea = apply_filters( 'pre_remote_source', $linea, $pagelinkedto );6296 $remote_source = apply_filters( 'pre_remote_source', $remote_source, $pagelinkedto ); 6295 6297 6296 6298 // Work around bug in strip_tags(): 6297 $ linea = str_replace('<!DOC', '<DOC', $linea);6298 $ linea = preg_replace( '/[\r\n\t ]+/', ' ', $linea); // normalize spaces6299 $ linea = preg_replace( "/<\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/", "\n\n", $linea);6300 6301 preg_match( '|<title>([^<]*?)</title>|is', $linea, $matchtitle);6299 $remote_source = str_replace( '<!DOC', '<DOC', $remote_source ); 6300 $remote_source = preg_replace( '/[\r\n\t ]+/', ' ', $remote_source ); // normalize spaces 6301 $remote_source = preg_replace( "/<\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/", "\n\n", $remote_source ); 6302 6303 preg_match( '|<title>([^<]*?)</title>|is', $remote_source, $matchtitle ); 6302 6304 $title = $matchtitle[1]; 6303 6305 if ( empty( $title ) ) 6304 6306 return $this->pingback_error( 32, __('We cannot find a title on that page.' ) ); 6305 6307 6306 $ linea = strip_tags( $linea, '<a>' ); // just keep the tag we need6307 6308 $p = explode( "\n\n", $ linea);6308 $remote_source = strip_tags( $remote_source, '<a>' ); // just keep the tag we need 6309 6310 $p = explode( "\n\n", $remote_source ); 6309 6311 6310 6312 $preg_target = preg_quote($pagelinkedto, '|'); … … 6354 6356 $comment_type = 'pingback'; 6355 6357 6356 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_content', 'comment_type'); 6358 $commentdata = compact( 6359 'comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 6360 'comment_content', 'comment_type', 'remote_source', 'remote_source_original' 6361 ); 6357 6362 6358 6363 $comment_ID = wp_new_comment($commentdata);
Note: See TracChangeset
for help on using the changeset viewer.