PluginProbe
ActivityPub / 8.0.2
ActivityPub v8.0.2
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/class-webfinger.php +1 -41 8.3.08.0.2 View file →
@@ -19,32 +19,8 @@
19 19 * @see https://webfinger.net/
20 20 */
21 21 class Webfinger {
22 22 /**
23 - * Check whether a value looks like an `acct` identifier.
24 - *
25 - * Accepts any of:
26 - *
27 - * - `user@host` — bare WebFinger handle.
28 - * - `@user@host` — Mastodon display form with a leading `@`.
29 - * - `acct:user@host` — full RFC 7565 URI form.
30 - *
31 - * The host/local-part pattern follows `ACTIVITYPUB_USERNAME_REGEXP`.
32 - *
33 - * @since 8.3.0
34 - *
35 - * @param mixed $value The candidate value.
36 - * @return bool True if the value matches the acct identifier pattern.
37 - */
38 - public static function is_acct( $value ) {
39 - if ( ! \is_string( $value ) || '' === $value ) {
40 - return false;
41 - }
42 -
43 - return (bool) \preg_match( '/^(?:acct:)?@?' . ACTIVITYPUB_USERNAME_REGEXP . '$/i', $value );
44 - }
45 -
46 - /**
47 23 * Returns a users WebFinger "resource".
48 24 *
49 25 * @param int $user_id The WordPress user id.
50 26 *
@@ -255,9 +231,9 @@
255 231 *
256 232 * @return string|\WP_Error Error or the Remote-Follow endpoint URI.
257 233 */
258 234 public static function get_remote_follow_endpoint( $uri ) {
259 - return self::get_intent_endpoint( $uri, 'follow', true );
235 + return self::get_intent_endpoint( $uri, 'http://ostatus.org/schema/1.0/subscribe' );
260 236 }
261 237
262 238 /**
263 239 * Generate a cache key for a given URI.
@@ -362,26 +338,10 @@
362 338 )
363 339 );
364 340 }
365 341
366 - /*
367 - * OStatus subscribe URL (deprecated but still widely supported)
368 - *
369 - * @see https://ostatus.github.io/spec/OStatus%201.0%20Draft%202.html#anchor10
370 - */
371 342 if ( isset( $links['http://ostatus.org/schema/1.0/subscribe'] ) ) {
372 343 return $links['http://ostatus.org/schema/1.0/subscribe'];
373 - }
374 -
375 - /*
376 - * FEP-3b86 Object Intent — the generic "open this object on my home
377 - * server" link, equivalent to pasting the URL into the home server's
378 - * search box. Useful when no verb-specific intent is advertised.
379 - *
380 - * @see https://codeberg.org/fediverse/fep/src/branch/main/fep/3b86/fep-3b86.md#5-1-object-intent
381 - */
382 - if ( isset( $links['https://w3id.org/fep/3b86/object'] ) ) {
383 - return $links['https://w3id.org/fep/3b86/object'];
384 344 }
385 345
386 346 // Last-resort: construct a Mastodon-compatible authorize_interaction URL.
387 347 $identifier_and_host = self::get_identifier_and_host( $uri );