You appear to be a bot. Output may be restricted
Description
Usage
Akismet::pre_check_pingback( $method );
Parameters
- $method
- ( mixed ) required –
Returns
void
Source
File name: akismet/class.akismet.php
Lines:
1 to 46 of 46
public static function pre_check_pingback( $method ) { if ( $method !== 'pingback.ping' ) return; global $wp_xmlrpc_server; if ( !is_object( $wp_xmlrpc_server ) ) return false; // Lame: tightly coupled with the IXR class. $args = $wp_xmlrpc_server->message->params; if ( !empty( $args[1] ) ) { $post_id = url_to_postid( $args[1] ); // If pingbacks aren't open on this post, we'll still check whether this request is part of a potential DDOS, // but indicate to the server that pingbacks are indeed closed so we don't include this request in the user's stats, // since the user has already done their part by disabling pingbacks. $pingbacks_closed = false; $post = get_post( $post_id ); if ( ! $post || ! pings_open( $post ) ) { $pingbacks_closed = true; } $comment = array( 'comment_author_url' => $args[0], 'comment_post_ID' => $post_id, 'comment_author' => '', 'comment_author_email' => '', 'comment_content' => '', 'comment_type' => 'pingback', 'akismet_pre_check' => '1', 'comment_pingback_target' => $args[1], 'pingbacks_closed' => $pingbacks_closed ? '1' : '0', ); $comment = Akismet::auto_check_comment( $comment ); if ( isset( $comment['akismet_result'] ) && 'true' == $comment['akismet_result'] ) { // Lame: tightly coupled with the IXR classes. Unfortunately the action provides no context and no way to return anything. $wp_xmlrpc_server->error( new IXR_Error( 0, 'Invalid discovery target' ) ); } } }