Make WordPress Core

Changeset 11106


Ignore:
Timestamp:
04/28/2009 12:05:43 AM (15 years ago)
Author:
ryan
Message:

Don't show password protected posts in searches for non-logged in users. Props coffee2code. fixes #9559

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r11086 r11106  
    17601760                $search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
    17611761
    1762             if ( !empty($search) )
     1762            if ( !empty($search) ) {
    17631763                $search = " AND ({$search}) ";
     1764                if ( !is_user_logged_in() )
     1765                    $search .= " AND ($wpdb->posts.post_password = '') ";
     1766            }
    17641767        }
    17651768
Note: See TracChangeset for help on using the changeset viewer.