Skip to content

Commit c8ea32a

Browse files
authored
Merge pull request #51 from pfefferle/fix/filter-by-rel-wp-error-check
Fix filter_by_rel to handle WP_Error objects
2 parents dea1bb0 + ea20d53 commit c8ea32a

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎includes/class-webfinger.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public static function generate_post_data( $webfinger, $resource_uri ) {
257257
*/
258258
public static function filter_by_rel( $webfinger ) {
259259
// Check if WebFinger is empty or has no links.
260-
if ( empty( $webfinger ) || ! isset( $webfinger['links'] ) ) {
260+
if ( \is_wp_error( $webfinger ) || empty( $webfinger ) || ! isset( $webfinger['links'] ) ) {
261261
return $webfinger;
262262
}
263263

‎readme.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- Tags: discovery, webfinger, JRD, ostatus, activitypub
66
- Requires at least: 4.2
77
- Tested up to: 6.9
8-
- Stable tag: 4.0.0
8+
- Stable tag: 4.0.1
99
- License: MIT
1010
- License URI: https://opensource.org/licenses/MIT
1111

@@ -91,6 +91,10 @@ This version drops classic WebFinger (XRD) support to keep the plugin lightweigh
9191

9292
Project maintained on github at [pfefferle/wordpress-webfinger](https://github.com/pfefferle/wordpress-webfinger).
9393

94+
### 4.0.1
95+
96+
* Fixed: Handle WP_Error objects in `filter_by_rel` to prevent errors when WebFinger lookup fails
97+
9498
### 4.0.0
9599

96100
* Added: Site Health integration to check your WebFinger setup status directly in WordPress

‎webfinger.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WebFinger
44
* Plugin URI: https://github.com/pfefferle/wordpress-webfinger
55
* Description: WebFinger for WordPress
6-
* Version: 4.0.0
6+
* Version: 4.0.1
77
* Author: Matthias Pfefferle
88
* Author URI: https://notiz.blog/
99
* License: MIT

0 commit comments

Comments
 (0)