Ensure more metadata
This commit is contained in:
parent
e065880085
commit
4d05d3710b
3 changed files with 4 additions and 4 deletions
|
@ -46,7 +46,7 @@ class Mention {
|
||||||
return \sprintf( '<a rel="mention" class="u-url mention href="%s">%s</a>', $metadata['url'], $username );
|
return \sprintf( '<a rel="mention" class="u-url mention href="%s">%s</a>', $metadata['url'], $username );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $username;
|
return $result[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function extract_mentions( $mentions, \ActivityPub\Model\Post $post ) {
|
public static function extract_mentions( $mentions, \ActivityPub\Model\Post $post ) {
|
||||||
|
|
|
@ -126,8 +126,6 @@ class Webfinger {
|
||||||
|
|
||||||
$url = \add_query_arg( 'resource', 'acct:' . ltrim( $account, '@' ), 'https://' . $m[1] . '/.well-known/webfinger' );
|
$url = \add_query_arg( 'resource', 'acct:' . ltrim( $account, '@' ), 'https://' . $m[1] . '/.well-known/webfinger' );
|
||||||
if ( ! \wp_http_validate_url( $url ) ) {
|
if ( ! \wp_http_validate_url( $url ) ) {
|
||||||
echo $url;
|
|
||||||
exit;
|
|
||||||
return new \WP_Error( 'invalid_webfinger_url', null, $url );
|
return new \WP_Error( 'invalid_webfinger_url', null, $url );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
class Test_Functions extends ActivityPub_TestCase_Cache_HTTP {
|
class Test_Functions extends ActivityPub_TestCase_Cache_HTTP {
|
||||||
public function test_get_remote_metadata_by_actor() {
|
public function test_get_remote_metadata_by_actor() {
|
||||||
$metadata = \ActivityPub\get_remote_metadata_by_actor( 'pfefferle@notiz.blog' );
|
$metadata = \ActivityPub\get_remote_metadata_by_actor( 'pfefferle@notiz.blog' );
|
||||||
$this->assertArrayHasKey( 'url', $metadata );
|
$this->assertEquals( 'https://notiz.blog/author/matthias-pfefferle/', $metadata['url'] );
|
||||||
|
$this->assertEquals( 'pfefferle', $metadata['preferredUsername'] );
|
||||||
|
$this->assertEquals( 'Matthias Pfefferle', $metadata['name'] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue