Skip to content

Trim API endpoint URL before saving - #63

Merged
kennym merged 2 commits into
kennym:masterfrom
emreyildirim-33:fix/trim-api-url
Oct 13, 2026
Merged

kennym merged 2 commits into
kennym:masterfrom
emreyildirim-33:fix/trim-api-url

Conversation

@emreyildirim-33

Copy link
Copy Markdown
Collaborator

Trailing whitespace in the API endpoint URL is currently percent-encoded by esc_url_raw() as %20, which changes the endpoint path and can cause requests to fail.

This trims surrounding whitespace before sanitizing the URL.

Regression coverage verifies that:

  • surrounding whitespace is removed
  • explicitly encoded %20 is preserved
  • clean URLs remain unchanged

Tested with WordPress on PHP 8.5.3.

@kennym kennym left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid PR. LGTM

@kennym

kennym commented Oct 12, 2026

Copy link
Copy Markdown
Owner

@emreyildirim-33 do we need a release for this?

This is the changelog line the release pull request will publish.
@kennym
kennym merged commit 3337d90 into kennym:master Oct 13, 2026
8 checks passed
@kennym

kennym commented Oct 13, 2026

Copy link
Copy Markdown
Owner

will be published with 1.5.4 - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants