diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ec046db8..7d5da1e88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Improved +* Basic enclosure validation * More User -> Actor renaming * Outsource Constants to a separate file * Better handling of `readme.txt` and `README.md` diff --git a/includes/functions.php b/includes/functions.php index d954e171f..eecc689dc 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1006,6 +1006,11 @@ function get_enclosures( $post_id ) { $enclosures = array_map( function ( $enclosure ) { + // Check if the enclosure is a string. + if ( ! $enclosure || ! is_string( $enclosure ) ) { + return false; + } + $attributes = explode( "\n", $enclosure ); if ( ! isset( $attributes[0] ) || ! \wp_http_validate_url( $attributes[0] ) ) { diff --git a/readme.txt b/readme.txt index db4f0bbda..ce8da4443 100644 --- a/readme.txt +++ b/readme.txt @@ -138,6 +138,7 @@ For reasons of data protection, it is not possible to see the followers of other * Added: Fediverse Preview on post-overview page * Added: GitHub action to enforce Changelog updates * Added: New contributors +* Improved: Basic enclosure validation * Improved: More User -> Actor renaming * Improved: Outsource Constants to a separate file * Improved: Better handling of `readme.txt` and `README.md`