diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 187b0213c2f..af909eeb699 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -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 = '';