In `wp_xmlrpc_server->pingback_ping()`, remove the internal variable `$way` each time it is set and not used.
See #30224. git-svn-id: https://develop.svn.wordpress.org/trunk@30139 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
eb05767743
commit
17e9c6f403
|
@ -5707,27 +5707,23 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
// if so, then let's use it and drop the old code.
|
||||
$urltest = parse_url($pagelinkedto);
|
||||
if ( $post_ID = url_to_postid($pagelinkedto) ) {
|
||||
$way = 'url_to_postid()';
|
||||
// $way
|
||||
} elseif ( isset( $urltest['path'] ) && preg_match('#p/[0-9]{1,}#', $urltest['path'], $match) ) {
|
||||
// the path defines the post_ID (archives/p/XXXX)
|
||||
$blah = explode('/', $match[0]);
|
||||
$post_ID = (int) $blah[1];
|
||||
$way = 'from the path';
|
||||
} elseif ( isset( $urltest['query'] ) && preg_match('#p=[0-9]{1,}#', $urltest['query'], $match) ) {
|
||||
// the querystring defines the post_ID (?p=XXXX)
|
||||
$blah = explode('=', $match[0]);
|
||||
$post_ID = (int) $blah[1];
|
||||
$way = 'from the querystring';
|
||||
} elseif ( isset($urltest['fragment']) ) {
|
||||
// an #anchor is there, it's either...
|
||||
if ( intval($urltest['fragment']) ) {
|
||||
// ...an integer #XXXX (simplest case)
|
||||
$post_ID = (int) $urltest['fragment'];
|
||||
$way = 'from the fragment (numeric)';
|
||||
} elseif ( preg_match('/post-[0-9]+/',$urltest['fragment']) ) {
|
||||
// ...a post id in the form 'post-###'
|
||||
$post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']);
|
||||
$way = 'from the fragment (post-###)';
|
||||
} elseif ( is_string($urltest['fragment']) ) {
|
||||
// ...or a string #title, a little more complicated
|
||||
$title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']);
|
||||
|
@ -5736,7 +5732,6 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
// returning unknown error '0' is better than die()ing
|
||||
return $this->pingback_error( 0, '' );
|
||||
}
|
||||
$way = 'from the fragment (title)';
|
||||
}
|
||||
} else {
|
||||
// TODO: Attempt to extract a post ID from the given URL
|
||||
|
|
Loading…
Reference in New Issue