Skip to content

Commit 92e46ed

Browse files
pfefferleobenland
andauthored
class-posts.php aktualisieren
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
1 parent 4844a73 commit 92e46ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/collection/class-posts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,13 @@ public static function purge( $days ) {
505505
* Local user comments have a user_id > 0, while Fediverse comments have user_id = 0.
506506
*/
507507
// phpcs:ignore WordPress.DB.DirectDatabaseQuery
508-
$local_comments = (int) $wpdb->get_var(
508+
$has_local_comments = (bool) $wpdb->get_var(
509509
$wpdb->prepare(
510-
"SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND user_id > 0",
510+
"SELECT 1 FROM $wpdb->comments WHERE comment_post_ID = %d AND user_id > 0 LIMIT 1",
511511
$post_id
512512
)
513513
);
514-
if ( $local_comments > 0 ) {
514+
if ( $has_local_comments ) {
515515
continue;
516516
}
517517

0 commit comments

Comments
 (0)