Search terms and phone numbers come back wrong after url_decode. A literal plus sign, which arrives encoded as %2B, is shown as a space. Customers searching for C++ see a page titled C developer, and phone links lose the…
Search terms and phone numbers come back wrong after url_decode. A literal plus sign, which arrives encoded as %2B, is shown as a space. Customers searching for C++ see a page titled C developer, and phone links lose their leading +.
{{ "1%2B1" | url_decode }}.{{ "C%2B%2B+developer" | url_decode }}.{{ "a+b c" | url_encode | url_decode }}.1+1C++ developera+b c1 1C developera b c+ in the input stands for a space and must keep doing so: {{ "hello+world" | url_decode }} gives hello world.%27, %21 and %25.url_encode and decoding it again should give the text back.Adapted from harttle/liquidjs (MIT).
Visible test command
TZ=UTC npx --no-install jest --ci --coverage=falseThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
url-decode-loses-plus-signs
Changes under src/ are evaluated.