WordPress.org

Make WordPress Core

Ticket #50873: 50873-search-query.diff

File 50873-search-query.diff, 538 bytes (added by daxelrod, 4 months ago)

Checks if the request is a search query before parsing the 's' query var.

  • wp-includes/class-wp-query.php

     
    21092109                        }
    21102110                }
    21112111
    2112                 // If a search pattern is specified, load the posts that match.
    2113                 if ( strlen( $q['s'] ) ) {
     2112                // If this is a search query, and a search pattern is specified, load the posts that match.
     2113                if ( $this->is_search && strlen( $q['s'] ) ) {
    21142114                        $search = $this->parse_search( $q );
    21152115                }
    21162116