Why is `yourls_encodeURI()` not part of `yourls_esc_url()`? #1807

Open
ozh opened this Issue Nov 6, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@ozh
Member

ozh commented Nov 6, 2014

At the moment yourls_encodeURI() is only used once, when adding a new URL. Why? Shouldn't it be part of yourls_esc_url() and be used by all function adding/editing URLs? (yourls_edit_link(), etc...)

  • write unit tests for yourls_add_new_url(), yourls_edit_link(), etc...
  • move yourls_encodeURI() into yourls_esc_url()

@ozh ozh added this to the 1.8 milestone Nov 6, 2014

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Nov 6, 2014

Member

More:

Adding (as new link, or when editing) http://example.com spits out a ton of %20.
Sanitization in yourls_esc_url() should probably begin with something like trim( yourls_encodeURI( $url ) ) -- check what it breaks.

Member

ozh commented Nov 6, 2014

More:

Adding (as new link, or when editing) http://example.com spits out a ton of %20.
Sanitization in yourls_esc_url() should probably begin with something like trim( yourls_encodeURI( $url ) ) -- check what it breaks.

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