modified file smtp-mailer
This commit is contained in:
@ -52,6 +52,17 @@ function get_remote_metadata_by_actor( $actor, $cached = true ) {
|
||||
if ( $pre ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
if ( is_array( $actor ) ) {
|
||||
if ( array_key_exists( 'id', $actor ) ) {
|
||||
$actor = $actor['id'];
|
||||
} elseif ( array_key_exists( 'url', $actor ) ) {
|
||||
$actor = $actor['url'];
|
||||
} else {
|
||||
return new WP_Error( 'activitypub_no_valid_actor_identifier', \__( 'The "actor" identifier is not valid', 'activitypub' ), array( 'status' => 404, 'actor' => $actor ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( preg_match( '/^@?' . ACTIVITYPUB_USERNAME_REGEXP . '$/i', $actor ) ) {
|
||||
$actor = Webfinger::resolve( $actor );
|
||||
}
|
||||
@ -134,7 +145,7 @@ function url_to_authorid( $url ) {
|
||||
global $wp_rewrite;
|
||||
|
||||
// check if url hase the same host
|
||||
if ( \wp_parse_url( \site_url(), \PHP_URL_HOST ) !== \wp_parse_url( $url, \PHP_URL_HOST ) ) {
|
||||
if ( \wp_parse_url( \home_url(), \PHP_URL_HOST ) !== \wp_parse_url( $url, \PHP_URL_HOST ) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user