Skip to content

Commit

Permalink
Fix URLs with quot; characters
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 27, 2016
1 parent a42e0bd commit 020b8c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions includes/widgets/class-wc-widget-layered-nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,12 @@ protected function get_page_base_url( $taxonomy ) {
$link = add_query_arg( 'orderby', wc_clean( $_GET['orderby'] ), $link );
}

// Search Arg
/**
* Search Arg.
* To support quote characters, first they are decoded from " entities, then URL encoded.
*/
if ( get_search_query() ) {
$link = add_query_arg( 's', get_search_query(), $link );
$link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link );
}

// Post Type Arg
Expand Down
7 changes: 5 additions & 2 deletions includes/widgets/class-wc-widget-rating-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ protected function get_page_base_url() {
$link = add_query_arg( 'orderby', wc_clean( $_GET['orderby'] ), $link );
}

// Search Arg
/**
* Search Arg.
* To support quote characters, first they are decoded from " entities, then URL encoded.
*/
if ( get_search_query() ) {
$link = add_query_arg( 's', get_search_query(), $link );
$link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link );
}

// Post Type Arg
Expand Down

0 comments on commit 020b8c9

Please sign in to comment.