PluginProbe
ActivityPub / 9.2.1
ActivityPub v9.2.1
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/handler/class-move.php +7 -5 8.2.19.2.1 View file →
@@ -61,10 +61,10 @@
61 61 global $wpdb;
62 62 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
63 63 $wpdb->update(
64 64 $wpdb->posts,
65 - array( 'guid' => sanitize_url( $target_uri ) ),
66 - array( 'ID' => sanitize_key( $origin_object->ID ) )
65 + array( 'guid' => \sanitize_url( $target_uri ) ),
66 + array( 'ID' => \sanitize_key( $origin_object->ID ) )
67 67 );
68 68
69 69 // Clear the cache.
70 70 \wp_cache_delete( $origin_object->ID, 'posts' );
@@ -69,9 +69,11 @@
69 69 // Clear the cache.
70 70 \wp_cache_delete( $origin_object->ID, 'posts' );
71 71
72 72 $success = true;
73 - $result = Remote_Actors::upsert( $target_json );
73 +
74 + // get_remote_object() already self-confirmed the target, so it is safe to cache.
75 + $result = Remote_Actors::upsert( $target_json );
74 76 }
75 77
76 78 // If both the target and origin are followed, merge them.
77 79 if ( ! \is_wp_error( $target_object ) && ! \is_wp_error( $origin_object ) ) {
@@ -176,9 +178,9 @@
176 178 return false;
177 179 }
178 180
179 181 // Collect all possible origin identifiers (id, url, webfinger).
180 - $origin_ids = array_filter(
182 + $origin_ids = \array_filter(
181 183 array(
182 184 $origin_object['id'] ?? null,
183 185 $origin_object['url'] ?? null,
184 186 $origin_object['webfinger'] ?? null,
@@ -185,9 +187,9 @@
185 187 )
186 188 );
187 189
188 190 // Check if any origin identifier is in the alsoKnownAs property of the target.
189 - if ( ! array_intersect( $origin_ids, $also_known_as ) ) {
191 + if ( ! \array_intersect( $origin_ids, $also_known_as ) ) {
190 192 return false;
191 193 }
192 194
193 195 // Check if the origin has a movedTo property.