Skip to content

Commit 695d460

Browse files
committed
Fix fatal error when Remote_Actors::get_actor() encounters WP_Error
When Actor::init_from_json() returns a WP_Error (e.g., due to corrupted or invalid JSON data), the code logged the error but continued executing, then tried calling get_webfinger() on the WP_Error object, causing a fatal error. Fixes #2675
1 parent 5c1accb commit 695d460

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Fix fatal error when Remote_Actors::get_actor() encounters invalid actor JSON data.

includes/collection/class-remote-actors.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ public static function get_actor( $post ) {
471471

472472
if ( \is_wp_error( $actor ) ) {
473473
self::add_error( $post->ID, $actor );
474+
return $actor;
474475
}
475476

476477
if ( ! $actor->get_webfinger() ) {

0 commit comments

Comments
 (0)