In `wp_xmlrpc_server->pingback_ping()`, remove the internal variable `$way` each time it is set and not used.
See #30224. Built from https://develop.svn.wordpress.org/trunk@30139 git-svn-id: http://core.svn.wordpress.org/trunk@30139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4f6745e9aa
commit
65ab0a188e
|
@ -5707,27 +5707,23 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
// if so, then let's use it and drop the old code.
|
// if so, then let's use it and drop the old code.
|
||||||
$urltest = parse_url($pagelinkedto);
|
$urltest = parse_url($pagelinkedto);
|
||||||
if ( $post_ID = url_to_postid($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) ) {
|
} elseif ( isset( $urltest['path'] ) && preg_match('#p/[0-9]{1,}#', $urltest['path'], $match) ) {
|
||||||
// the path defines the post_ID (archives/p/XXXX)
|
// the path defines the post_ID (archives/p/XXXX)
|
||||||
$blah = explode('/', $match[0]);
|
$blah = explode('/', $match[0]);
|
||||||
$post_ID = (int) $blah[1];
|
$post_ID = (int) $blah[1];
|
||||||
$way = 'from the path';
|
|
||||||
} elseif ( isset( $urltest['query'] ) && preg_match('#p=[0-9]{1,}#', $urltest['query'], $match) ) {
|
} elseif ( isset( $urltest['query'] ) && preg_match('#p=[0-9]{1,}#', $urltest['query'], $match) ) {
|
||||||
// the querystring defines the post_ID (?p=XXXX)
|
// the querystring defines the post_ID (?p=XXXX)
|
||||||
$blah = explode('=', $match[0]);
|
$blah = explode('=', $match[0]);
|
||||||
$post_ID = (int) $blah[1];
|
$post_ID = (int) $blah[1];
|
||||||
$way = 'from the querystring';
|
|
||||||
} elseif ( isset($urltest['fragment']) ) {
|
} elseif ( isset($urltest['fragment']) ) {
|
||||||
// an #anchor is there, it's either...
|
// an #anchor is there, it's either...
|
||||||
if ( intval($urltest['fragment']) ) {
|
if ( intval($urltest['fragment']) ) {
|
||||||
// ...an integer #XXXX (simplest case)
|
// ...an integer #XXXX (simplest case)
|
||||||
$post_ID = (int) $urltest['fragment'];
|
$post_ID = (int) $urltest['fragment'];
|
||||||
$way = 'from the fragment (numeric)';
|
|
||||||
} elseif ( preg_match('/post-[0-9]+/',$urltest['fragment']) ) {
|
} elseif ( preg_match('/post-[0-9]+/',$urltest['fragment']) ) {
|
||||||
// ...a post id in the form 'post-###'
|
// ...a post id in the form 'post-###'
|
||||||
$post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']);
|
$post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']);
|
||||||
$way = 'from the fragment (post-###)';
|
|
||||||
} elseif ( is_string($urltest['fragment']) ) {
|
} elseif ( is_string($urltest['fragment']) ) {
|
||||||
// ...or a string #title, a little more complicated
|
// ...or a string #title, a little more complicated
|
||||||
$title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']);
|
$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
|
// returning unknown error '0' is better than die()ing
|
||||||
return $this->pingback_error( 0, '' );
|
return $this->pingback_error( 0, '' );
|
||||||
}
|
}
|
||||||
$way = 'from the fragment (title)';
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: Attempt to extract a post ID from the given URL
|
// TODO: Attempt to extract a post ID from the given URL
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.1-alpha-30138';
|
$wp_version = '4.1-alpha-30139';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue