This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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 ) ) {
You can’t perform that action at this time.
0 commit comments