Skip to content

Commit f33ee44

Browse files
Coding Standards: Use strict comparison in wp_xmlrpc_server::pingback_ping().
Follow-up to [2983], [55365]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59663 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2f65488 commit f33ee44

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/wp-includes/class-wp-xmlrpc-server.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6885,6 +6885,7 @@ public function pingback_ping( $args ) {
68856885
*/
68866886
$urltest = parse_url( $pagelinkedto );
68876887
$post_id = url_to_postid( $pagelinkedto );
6888+
68886889
if ( $post_id ) {
68896890
// $way
68906891
} elseif ( isset( $urltest['path'] ) && preg_match( '#p/[0-9]{1,}#', $urltest['path'], $match ) ) {
@@ -6917,15 +6918,15 @@ public function pingback_ping( $args ) {
69176918
// TODO: Attempt to extract a post ID from the given URL.
69186919
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.' ) );
69196920
}
6920-
$post_id = (int) $post_id;
69216921

6922-
$post = get_post( $post_id );
6922+
$post_id = (int) $post_id;
6923+
$post = get_post( $post_id );
69236924

69246925
if ( ! $post ) { // Post not found.
69256926
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.' ) );
69266927
}
69276928

6928-
if ( url_to_postid( $pagelinkedfrom ) == $post_id ) {
6929+
if ( url_to_postid( $pagelinkedfrom ) === $post_id ) {
69296930
return $this->pingback_error( 0, __( 'The source URL and the target URL cannot both point to the same resource.' ) );
69306931
}
69316932

0 commit comments

Comments
 (0)