Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions feed-parsers/class-feed-parser-activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ public function get_activitypub_actor( $user_id ) {
}

public static function get_activitypub_actor_id( $user_id ) {
if ( null !== $user_id && ! \Activitypub\user_can_activitypub( $user_id ) ) {
if ( null !== $user_id && \function_exists( '\Activitypub\user_can_activitypub' ) && ! \Activitypub\user_can_activitypub( $user_id ) ) {
$user_id = null;
}
if ( null === $user_id ) {
Expand Down Expand Up @@ -1266,6 +1266,10 @@ public function activitypub_extract_in_reply_to_mentions( $mentions, $comment_co
}

public static function extract_html_mentions( $content ) {
if ( ! class_exists( '\WP_HTML_Tag_Processor' ) ) {
return $content;
}

$tags = new \WP_HTML_Tag_Processor( $content );
$mentions = array();
while ( $tags->next_tag(
Expand Down Expand Up @@ -2574,7 +2578,7 @@ public function activitypub_comment_post_id( $post_id, $url, $activity ) {
}

public function the_content( $the_content ) {
if ( ! Friends::on_frontend() ) {
if ( ! Friends::on_frontend() || ! class_exists( '\WP_HTML_Tag_Processor' ) ) {
return $the_content;
}

Expand Down