Hi @vaakash
Here are the changes I made in the form of patches:
Index: includes/utilities.php
===================================================================
--- includes/utilities.php (revision 3106204)
+++ includes/utilities.php (working copy)
@@ -23,7 +23,7 @@
global $post;
- preg_match_all( '~<img.*?src=["\']+(.*?)["\']+~', $content, $image_urls );
+ preg_match_all( '~<img.*?src=["\']+(.*?)["\']+~', $content ?? '', $image_urls );
if( empty( $image_urls[1] ) && has_post_thumbnail( $post->ID ) ) {
$content = '<p>' . get_the_post_thumbnail( $post->ID ) . '</p>' . $content;
@@ -85,7 +85,7 @@
);
foreach( $attributes as $attribute => $regex ){
- preg_match( $regex, $content, $urls );
+ preg_match( $regex, $content ?? '', $urls );
if( empty( $urls ) ){
continue;
Index: includes/feed.php
===================================================================
--- includes/feed.php (revision 3078518)
+++ includes/feed.php (working copy)
@@ -92,7 +92,7 @@
if( is_wp_error( $feed ) ){
$feed_title = __( 'Error' );
}else{
- $feed_title = ( isset( $tab_titles[$i] ) && !empty( $tab_titles[$i] ) ) ? $tab_titles[$i] : strip_tags( $feed->get_title() );
+ $feed_title = ( isset( $tab_titles[$i] ) && !empty( $tab_titles[$i] ) ) ? $tab_titles[$i] : strip_tags( $feed->get_title() ?? '' );
}
$feeds[ $feed_url ] = array(
@@ -163,7 +163,7 @@
$link = strip_tags($link);
// Title
- $title = strip_tags( $item->get_title() );
+ $title = strip_tags( $item->get_title() ?? '' );
$title_full = $title;
if ( empty( $title ) ){
@@ -187,7 +187,7 @@
// Date
$date = '';
- $date_full = strip_tags( $item->get_date() );
+ $date_full = strip_tags( $item->get_date() ?? '' );
if( strtolower( $date_format ) == 'relative' ){
$item_date = $item->get_date( 'U' );
@@ -228,7 +228,7 @@
// Description
$desc = '';
if( $show_desc ){
- $desc_content = ( $desc_type == 'summary' ) ? $item->get_description() : $item->get_content();
+ $desc_content = ( $desc_type == 'summary' ) ? ( $item->get_description() ?? '') : ( $item->get_content() ?? '' );
if( $rich_desc ){
$desc = wp_kses_post( strip_tags( $desc_content, '<p><a><img><em><strong><font><strike><s><u><b><i><br>' ) );
}else{
The changes are to avoid working on non-strings (invalid values).
Greetings
Roland