PluginProbe
wpForo Forum / 3.1.6
wpForo Forum v3.1.6
3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 138 releases
← All changes | classes/VectorStorageManager.php +5 -1 3.1.23.1.6 View file →
@@ -563,13 +563,15 @@
563 563 if ( isset( $topic['status'] ) && (int) $topic['status'] !== 0 ) {
564 564 return new \WP_Error( 'unapproved_topic', wpforo_phrase( 'Unapproved topics cannot be indexed', false ) );
565 565 }
566 566
567 - // Get all posts for this topic ordered by creation date
567 + // Get all approved posts for this topic ordered by creation date
568 + // Only index approved posts (status=0) to prevent unapproved content from appearing in search
568 569 $posts = WPF()->post->get_posts( [
569 570 'topicid' => $topicid,
570 571 'orderby' => 'created',
571 572 'order' => 'ASC',
573 + 'status' => 0,
572 574 ] );
573 575 if ( empty( $posts ) ) {
574 576 return new \WP_Error( 'no_posts', wpforo_phrase( 'No posts found for topic', false ) );
575 577 }
@@ -826,12 +828,14 @@
826 828 }
827 829
828 830 // Bypass user permission check - this is admin-initiated backend indexing.
829 831 // Private/unapproved topics are already filtered above.
832 + // Only index approved posts (status=0) to prevent unapproved content from appearing in search.
830 833 $posts = WPF()->post->get_posts( [
831 834 'topicid' => $topicid,
832 835 'orderby' => 'created',
833 836 'order' => 'ASC',
837 + 'status' => 0,
834 838 'check_private' => false,
835 839 ] );
836 840
837 841 if ( empty( $posts ) ) {