Replace full stops before parse_str

This commit is contained in:
Mike Jolley 2019-04-02 13:58:37 +01:00
parent d69f014807
commit a66adf0829
1 changed files with 10 additions and 1 deletions

View File

@ -686,7 +686,16 @@ function wc_query_string_form_fields( $values = null, $exclude = array(), $curre
$values = array();
if ( ! empty( $url_parts['query'] ) ) {
parse_str( $url_parts['query'], $values );
// This is to preserve full-stops in the query string when ran through parse_str.
$query_string = str_replace( '.', '{dot}', $url_parts['query'] );
// Parse the string.
parse_str( $query_string, $parsed_query_string );
// Convert the full-stops back and add to values array.
foreach ( $parsed_query_string as $key => $value ) {
$values[ str_replace( '{dot}', '.', $key ) ] = $value;
}
}
}
$html = '';