Skip to content

Commit

Permalink
fix escaping URLs in navigation links
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Jan 29, 2024
1 parent 44df307 commit 05fec26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ function block_core_navigation_link_maybe_urldecode( $url ) {
$query_params = wp_parse_args( $query );

foreach ( $query_params as $query_param ) {
$can_query_param_be_encoded = is_string( $query_param ) && ! empty( $query_param );
if ( ! $can_query_param_be_encoded ) {
continue;
}
if ( rawurldecode( $query_param ) !== $query_param ) {
$is_url_encoded = true;
break;
Expand Down

0 comments on commit 05fec26

Please sign in to comment.