Skip to content

Commit

Permalink
Merge pull request #6 from indieweb/mm/php8-empty-fragment-query
Browse files Browse the repository at this point in the history
build_url: treat empty fragment/query as absent
  • Loading branch information
aaronpk authored May 24, 2023
2 parents 8514c48 + 3831455 commit 97731c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mf2/representative-h-card.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ function build_url($parsed_url) {
$pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
$pass = ($user || $pass) ? "$pass@" : '';
$path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
$query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
$fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
$query = !empty($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
$fragment = !empty($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
return "$scheme$user$pass$host$port$path$query$fragment";
}

Expand Down

0 comments on commit 97731c6

Please sign in to comment.