modified file smtp-mailer

This commit is contained in:
2024-06-27 12:11:15 +00:00
committed by Gitium
parent 91db4aebe1
commit 19e351ef3b
1005 changed files with 230351 additions and 8670 deletions

View File

@ -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;
}