Merge pull request #17810 from woocommerce/fix/17762
Apostrophe in product search breaks nav filters (invalid characters in hrefs & form data)
This commit is contained in:
commit
99d8d30ec0
|
@ -412,7 +412,7 @@ function wc_query_string_form_fields( $values = null, $exclude = array(), $curre
|
|||
if ( is_array( $value ) ) {
|
||||
$html .= wc_query_string_form_fields( $value, $exclude, $key, true );
|
||||
} else {
|
||||
$html .= '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( $value ) . '" />';
|
||||
$html .= '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( wp_unslash( $value ) ) . '" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ class WC_Widget_Layered_Nav_Filters extends WC_Widget {
|
|||
* To support quote characters, first they are decoded from " entities, then URL encoded.
|
||||
*/
|
||||
if ( get_search_query() ) {
|
||||
$link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link );
|
||||
$link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query( false ) ) ), $link );
|
||||
}
|
||||
|
||||
// Post Type Arg
|
||||
|
|
|
@ -356,7 +356,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
|
|||
* To support quote characters, first they are decoded from " entities, then URL encoded.
|
||||
*/
|
||||
if ( get_search_query() ) {
|
||||
$link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link );
|
||||
$link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query( false ) ) ), $link );
|
||||
}
|
||||
|
||||
// Post Type Arg.
|
||||
|
|
Loading…
Reference in New Issue