locutusjs/locutus

locutus/php/url/urlencode not converting '~' to '%7E'

tpirc3 opened this issue · 2 comments

  • Have you checked the guidelines in our Contributing document?

Description

PHP's urlencode will convert '~' into '%7E'
urlencode('~') === '%7E'

locutus/php/url/urlencode doesn't convert '~'
require('locutus/php/url/urlencode')('~') === '~'

Since encodeURIComponent not converting '~', may need to add .replace(/~/g, '%7E') in locutus/php/url/urlencode's implementation.

seems like the obvious course of action, try making a PR :)

notably rawurlencode() keeps ~ intact, urlenode() does not.