Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu...
File: class-wp-xmlrpc-server.php
[7000] Fix | Delete
// Remove all script and style tags including their content.
[7001] Fix | Delete
$remote_source = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $remote_source );
[7002] Fix | Delete
// Just keep the tag we need.
[7003] Fix | Delete
$remote_source = strip_tags( $remote_source, '<a>' );
[7004] Fix | Delete
[7005] Fix | Delete
$p = explode( "\n\n", $remote_source );
[7006] Fix | Delete
[7007] Fix | Delete
$preg_target = preg_quote( $pagelinkedto, '|' );
[7008] Fix | Delete
[7009] Fix | Delete
foreach ( $p as $para ) {
[7010] Fix | Delete
if ( str_contains( $para, $pagelinkedto ) ) { // It exists, but is it a link?
[7011] Fix | Delete
preg_match( '|<a[^>]+?' . $preg_target . '[^>]*>([^>]+?)</a>|', $para, $context );
[7012] Fix | Delete
[7013] Fix | Delete
// If the URL isn't in a link context, keep looking.
[7014] Fix | Delete
if ( empty( $context ) ) {
[7015] Fix | Delete
continue;
[7016] Fix | Delete
}
[7017] Fix | Delete
[7018] Fix | Delete
/*
[7019] Fix | Delete
* We're going to use this fake tag to mark the context in a bit.
[7020] Fix | Delete
* The marker is needed in case the link text appears more than once in the paragraph.
[7021] Fix | Delete
*/
[7022] Fix | Delete
$excerpt = preg_replace( '|\</?wpcontext\>|', '', $para );
[7023] Fix | Delete
[7024] Fix | Delete
// prevent really long link text
[7025] Fix | Delete
if ( strlen( $context[1] ) > 100 ) {
[7026] Fix | Delete
$context[1] = substr( $context[1], 0, 100 ) . '&#8230;';
[7027] Fix | Delete
}
[7028] Fix | Delete
[7029] Fix | Delete
$marker = '<wpcontext>' . $context[1] . '</wpcontext>'; // Set up our marker.
[7030] Fix | Delete
$excerpt = str_replace( $context[0], $marker, $excerpt ); // Swap out the link for our marker.
[7031] Fix | Delete
$excerpt = strip_tags( $excerpt, '<wpcontext>' ); // Strip all tags but our context marker.
[7032] Fix | Delete
$excerpt = trim( $excerpt );
[7033] Fix | Delete
$preg_marker = preg_quote( $marker, '|' );
[7034] Fix | Delete
$excerpt = preg_replace( "|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt );
[7035] Fix | Delete
$excerpt = strip_tags( $excerpt ); // YES, again, to remove the marker wrapper.
[7036] Fix | Delete
break;
[7037] Fix | Delete
}
[7038] Fix | Delete
}
[7039] Fix | Delete
[7040] Fix | Delete
if ( empty( $context ) ) { // Link to target not found.
[7041] Fix | Delete
return $this->pingback_error( 17, __( 'The source URL does not contain a link to the target URL, and so cannot be used as a source.' ) );
[7042] Fix | Delete
}
[7043] Fix | Delete
[7044] Fix | Delete
$pagelinkedfrom = str_replace( '&', '&amp;', $pagelinkedfrom );
[7045] Fix | Delete
[7046] Fix | Delete
$context = '[&#8230;] ' . esc_html( $excerpt ) . ' [&#8230;]';
[7047] Fix | Delete
$pagelinkedfrom = $this->escape( $pagelinkedfrom );
[7048] Fix | Delete
[7049] Fix | Delete
$comment_post_id = (int) $post_id;
[7050] Fix | Delete
$comment_author = $title;
[7051] Fix | Delete
$comment_author_email = '';
[7052] Fix | Delete
$this->escape( $comment_author );
[7053] Fix | Delete
$comment_author_url = $pagelinkedfrom;
[7054] Fix | Delete
$comment_content = $context;
[7055] Fix | Delete
$this->escape( $comment_content );
[7056] Fix | Delete
$comment_type = 'pingback';
[7057] Fix | Delete
[7058] Fix | Delete
$commentdata = array(
[7059] Fix | Delete
'comment_post_ID' => $comment_post_id,
[7060] Fix | Delete
);
[7061] Fix | Delete
[7062] Fix | Delete
$commentdata += compact(
[7063] Fix | Delete
'comment_author',
[7064] Fix | Delete
'comment_author_url',
[7065] Fix | Delete
'comment_author_email',
[7066] Fix | Delete
'comment_content',
[7067] Fix | Delete
'comment_type',
[7068] Fix | Delete
'remote_source',
[7069] Fix | Delete
'remote_source_original'
[7070] Fix | Delete
);
[7071] Fix | Delete
[7072] Fix | Delete
$comment_id = wp_new_comment( $commentdata );
[7073] Fix | Delete
[7074] Fix | Delete
if ( is_wp_error( $comment_id ) ) {
[7075] Fix | Delete
return $this->pingback_error( 0, $comment_id->get_error_message() );
[7076] Fix | Delete
}
[7077] Fix | Delete
[7078] Fix | Delete
/**
[7079] Fix | Delete
* Fires after a post pingback has been sent.
[7080] Fix | Delete
*
[7081] Fix | Delete
* @since 0.71
[7082] Fix | Delete
*
[7083] Fix | Delete
* @param int $comment_id Comment ID.
[7084] Fix | Delete
*/
[7085] Fix | Delete
do_action( 'pingback_post', $comment_id );
[7086] Fix | Delete
[7087] Fix | Delete
/* translators: 1: URL of the page linked from, 2: URL of the page linked to. */
[7088] Fix | Delete
return sprintf( __( 'Pingback from %1$s to %2$s registered. Keep the web talking! :-)' ), $pagelinkedfrom, $pagelinkedto );
[7089] Fix | Delete
}
[7090] Fix | Delete
[7091] Fix | Delete
/**
[7092] Fix | Delete
* Retrieves an array of URLs that pingbacked the given URL.
[7093] Fix | Delete
*
[7094] Fix | Delete
* Specs on http://www.aquarionics.com/misc/archives/blogite/0198.html
[7095] Fix | Delete
*
[7096] Fix | Delete
* @since 1.5.0
[7097] Fix | Delete
*
[7098] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[7099] Fix | Delete
*
[7100] Fix | Delete
* @param string $url
[7101] Fix | Delete
* @return array|IXR_Error
[7102] Fix | Delete
*/
[7103] Fix | Delete
public function pingback_extensions_getPingbacks( $url ) {
[7104] Fix | Delete
global $wpdb;
[7105] Fix | Delete
[7106] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[7107] Fix | Delete
do_action( 'xmlrpc_call', 'pingback.extensions.getPingbacks', $url, $this );
[7108] Fix | Delete
[7109] Fix | Delete
$url = $this->escape( $url );
[7110] Fix | Delete
[7111] Fix | Delete
$post_id = url_to_postid( $url );
[7112] Fix | Delete
if ( ! $post_id ) {
[7113] Fix | Delete
// We aren't sure that the resource is available and/or pingback enabled.
[7114] Fix | Delete
return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either does not exist, or it is not a pingback-enabled resource.' ) );
[7115] Fix | Delete
}
[7116] Fix | Delete
[7117] Fix | Delete
$actual_post = get_post( $post_id, ARRAY_A );
[7118] Fix | Delete
[7119] Fix | Delete
if ( ! $actual_post ) {
[7120] Fix | Delete
// No such post = resource not found.
[7121] Fix | Delete
return $this->pingback_error( 32, __( 'The specified target URL does not exist.' ) );
[7122] Fix | Delete
}
[7123] Fix | Delete
[7124] Fix | Delete
$comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );
[7125] Fix | Delete
[7126] Fix | Delete
if ( ! $comments ) {
[7127] Fix | Delete
return array();
[7128] Fix | Delete
}
[7129] Fix | Delete
[7130] Fix | Delete
$pingbacks = array();
[7131] Fix | Delete
foreach ( $comments as $comment ) {
[7132] Fix | Delete
if ( 'pingback' === $comment->comment_type ) {
[7133] Fix | Delete
$pingbacks[] = $comment->comment_author_url;
[7134] Fix | Delete
}
[7135] Fix | Delete
}
[7136] Fix | Delete
[7137] Fix | Delete
return $pingbacks;
[7138] Fix | Delete
}
[7139] Fix | Delete
[7140] Fix | Delete
/**
[7141] Fix | Delete
* Sends a pingback error based on the given error code and message.
[7142] Fix | Delete
*
[7143] Fix | Delete
* @since 3.6.0
[7144] Fix | Delete
*
[7145] Fix | Delete
* @param int $code Error code.
[7146] Fix | Delete
* @param string $message Error message.
[7147] Fix | Delete
* @return IXR_Error Error object.
[7148] Fix | Delete
*/
[7149] Fix | Delete
protected function pingback_error( $code, $message ) {
[7150] Fix | Delete
/**
[7151] Fix | Delete
* Filters the XML-RPC pingback error return.
[7152] Fix | Delete
*
[7153] Fix | Delete
* @since 3.5.1
[7154] Fix | Delete
*
[7155] Fix | Delete
* @param IXR_Error $error An IXR_Error object containing the error code and message.
[7156] Fix | Delete
*/
[7157] Fix | Delete
return apply_filters( 'xmlrpc_pingback_error', new IXR_Error( $code, $message ) );
[7158] Fix | Delete
}
[7159] Fix | Delete
}
[7160] Fix | Delete
[7161] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function