Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Packages\Url: Trim leading and trailing whitespaces #17320

Conversation

@donmhico
Copy link
Contributor

commented Sep 4, 2019

Description

Trims the trailing and leading whitespaces in the url.

Fixes #17314.

How has this been tested?

  1. Create a new post.
  2. Insert a link with different url formats [ ] means whitespace.
  3. URLs above work as expected.

Types of changes

Bug fix.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
@@ -360,6 +360,7 @@ export function removeQueryArgs( url, ...args ) {
* @return {string} The updated URL.
*/
export function prependHTTP( url ) {
url = url.trim();

This comment has been minimized.

Copy link
@gziolo

gziolo Sep 4, 2019

Member

Can you add unit test which covers it?

@gziolo
gziolo approved these changes Sep 4, 2019
Copy link
Member

left a comment

Cool, thanks for including unit test. I will merge as soon as Travis CI confirms everything is valid.

@gziolo gziolo added this to the Gutenberg 6.5 milestone Sep 4, 2019
@gziolo gziolo merged commit e420ac2 into WordPress:master Sep 4, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
…7320)

* Fix: Packages\Url: Trim leading and trailing whitespaces

* Added unit tests for prependHTTP()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.