PluginProbe
ActivityPub / 5.7.0
ActivityPub v5.7.0
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-link.php +13 -10 9.2.05.7.0 View file →
@@ -27,9 +27,12 @@
27 27 *
28 28 * @return array Rhe activity object array.
29 29 */
30 30 public static function filter_activity_object( $activity ) {
31 - if ( ! empty( $activity['summary'] ) && is_actor( $activity ) ) {
31 + /* phpcs:ignore Squiz.PHP.CommentedOutCode.Found
32 + Only changed it for Person and Group as long is not merged: https://github.com/mastodon/mastodon/pull/28629
33 + */
34 + if ( ! empty( $activity['summary'] ) && in_array( $activity['type'], array( 'Person', 'Group' ), true ) ) {
32 35 $activity['summary'] = self::the_content( $activity['summary'] );
33 36 }
34 37
35 38 if ( ! empty( $activity['content'] ) ) {
@@ -59,12 +62,12 @@
59 62 *
60 63 * @return string The final string.
61 64 */
62 65 public static function replace_with_links( $result ) {
63 - if ( 'www.' === \substr( $result[0], 0, 4 ) ) {
66 + if ( 'www.' === substr( $result[0], 0, 4 ) ) {
64 67 $result[0] = 'https://' . $result[0];
65 68 }
66 - $parsed_url = \wp_parse_url( \html_entity_decode( $result[0] ) );
69 + $parsed_url = \wp_parse_url( html_entity_decode( $result[0] ) );
67 70 if ( ! $parsed_url || empty( $parsed_url['host'] ) ) {
68 71 return $result[0];
69 72 }
70 73
@@ -83,10 +86,10 @@
83 86 $invisible_prefix .= '@';
84 87 }
85 88
86 89 $text_url = $parsed_url['host'];
87 - if ( 'www.' === \substr( $text_url, 0, 4 ) ) {
88 - $text_url = \substr( $text_url, 4 );
90 + if ( 'www.' === substr( $text_url, 0, 4 ) ) {
91 + $text_url = substr( $text_url, 4 );
89 92 $invisible_prefix .= 'www.';
90 93 }
91 94 if ( ! empty( $parsed_url['port'] ) ) {
92 95 $text_url .= ':' . $parsed_url['port'];
@@ -113,17 +116,17 @@
113 116 * Filters the rel attribute for ActivityPub links.
114 117 *
115 118 * @param string $rel The rel attribute string. Default 'nofollow noopener noreferrer'.
116 119 */
117 - $rel = \apply_filters( 'activitypub_link_rel', 'nofollow noopener noreferrer' );
120 + $rel = apply_filters( 'activitypub_link_rel', 'nofollow noopener noreferrer' );
118 121
119 122 return \sprintf(
120 123 '<a href="%s" target="_blank" rel="%s" translate="no"><span class="invisible">%s</span><span class="%s">%s</span><span class="invisible">%s</span></a>',
121 - \esc_url( $result[0] ),
124 + esc_url( $result[0] ),
122 125 $rel,
123 - \esc_html( $invisible_prefix ),
126 + esc_html( $invisible_prefix ),
124 127 $display_class,
125 - \esc_html( $display ),
126 - \esc_html( $invisible_suffix )
128 + esc_html( $display ),
129 + esc_html( $invisible_suffix )
127 130 );
128 131 }
129 132 }