Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ The code on this repository has to match the WordPress Coding Standards in order
Every pull request will be checked against WPCS through GitHub Actions.

## Version History
### 2.1.1
* Bugfix - Ignore trailing slash in public url (prevents potential double slash when filtering first path parameter)

### 2.1.0
* Added - Ignore Path Segments setting to remove specific path segments when building public URLs
* Enhanced - Public URL functionality to handle complex URL transformations
Expand Down
5 changes: 4 additions & 1 deletion siteimprove/admin/class-siteimprove-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ private function siteimprove_add_js( $url, $type ) {

// Apply public URL transformation if configured.
if ( ! empty( $public_url ) ) {
$url = "$public_url$path" . ( isset( $parsed_url['query'] ) ? "?$parsed_url[query]" : '' );
$public_url = rtrim( $public_url, '/' );
$normalized_path = '/' . ltrim( $path, '/' );
$query_string = isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '';
$url = $public_url . $normalized_path . $query_string;
} else {
// If no public URL is set, reconstruct the URL with the filtered path.
$scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] . '://' : '';
Expand Down
3 changes: 3 additions & 0 deletions siteimprove/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ Please review whether you have JavaScript turned off in your browser. We use Jav


== Changelog ==
= 2.1.1 =
* Bugfix - Ignore trailing slash in public url (prevents potential double slash when filtering first path parameter)

= 2.1.0 =
* Added - Ignore Path Segments setting to remove specific path segments when building public URLs
* Enhanced - Public URL functionality to handle complex URL transformations
Expand Down
Loading