Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 20d568a

Browse files
committed
some coding-style fixes
1 parent 07ba4db commit 20d568a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

includes/class-linkbacks-mf2-handler.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,19 +437,19 @@ public static function flatten_microformats( $item ) {
437437
}
438438

439439
public static function has_alternate_url( $mf_array ) {
440-
return ( bool ) self::get_alternate_url( $mf_array );
440+
return (bool) self::get_alternate_url( $mf_array );
441441
}
442442

443443
public static function get_alternate_url( $mf_array ) {
444444
if ( ! array_key_exists( 'rel-urls', $mf_array ) ) {
445445
return false;
446446
}
447447

448-
foreach ( $mf_array['rel-urls'] as $url => $meta ) ) {
448+
foreach ( $mf_array['rel-urls'] as $url => $meta ) {
449449
if (
450-
$meta['type'] === 'application/mf2+json' &&
451-
in_array( 'alternate', $meta['rels'] ) &&
452-
filter_var($url, FILTER_VALIDATE_URL) !== false
450+
'application/mf2+json' === trim( $meta['type'] ) &&
451+
in_array( 'alternate', $meta['rels'], true ) &&
452+
filter_var( $url, FILTER_VALIDATE_URL ) !== false
453453
) {
454454
return $url;
455455
}
@@ -472,6 +472,7 @@ public static function get_alternate_source( $mf_array ) {
472472
'redirection' => 20,
473473
'user-agent' => "$user_agent; Semantic-Linkbacks/Webmention read rel-alternate source",
474474
);
475+
475476
$response = wp_safe_remote_get( $url, $args );
476477
// check if source is accessible
477478
if ( is_wp_error( $response ) ) {

0 commit comments

Comments
 (0)