WordPress.org

Make WordPress Core

Ticket #11153: 11153.diff

File 11153.diff, 966 bytes (added by tenpura, 9 years ago)

urlencode search query

  • link-template.php

     
    619619 */
    620620function get_search_feed_link($search_query = '', $feed = '') {
    621621        if ( empty($search_query) )
    622                 $search = esc_attr(get_search_query());
     622                $search = esc_attr(urlencode(get_search_query()));
    623623        else
    624                 $search = esc_attr(stripslashes($search_query));
     624                $search = esc_attr(urlencode(stripslashes($search_query)));
    625625
    626626        if ( empty($feed) )
    627627                $feed = get_default_feed();
     
    644644 */
    645645function get_search_comments_feed_link($search_query = '', $feed = '') {
    646646        if ( empty($search_query) )
    647                 $search = esc_attr(get_search_query());
     647                $search = esc_attr(urlencode(get_search_query()));
    648648        else
    649                 $search = esc_attr(stripslashes($search_query));
     649                $search = esc_attr(urlencode(stripslashes($search_query)));
    650650
    651651        if ( empty($feed) )
    652652                $feed = get_default_feed();