You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to lack of check for zero date, function 'get_post_year_range' returns range [0,2022].
After that function 'check_year_has_posts' returns [22,2022] and this is how we are getting date '22-11-18'.
Suggested fix:
$oldest_post_date_year = $wpdb->get_var( "SELECT DISTINCT YEAR(post_date) as year FROM $wpdb->posts WHERE post_status = 'publish' AND post_date > 0 ORDER BY year ASC LIMIT 1" );
I hope, you will find time, to fix this.
Thank you.
The text was updated successfully, but these errors were encountered:
Hi there,
If a published post of any type has 'post_date' equals to '0000-00-00 00:00:00', on PHP 8.1, when generating sitemap, fatal error will be thrown.
The problem in this SQL query.
Due to lack of check for zero date, function 'get_post_year_range' returns range [0,2022].
After that function 'check_year_has_posts' returns [22,2022] and this is how we are getting date '22-11-18'.
Suggested fix:
I hope, you will find time, to fix this.
Thank you.
The text was updated successfully, but these errors were encountered: