wevisdemo / design-systems

WeVis monorepo for design system documentation and cross-framework UI components
https://wevisdemo.github.io/design-systems/
MIT License
16 stars 2 forks source link

Sharer should be using `encodeURIComponent` #15

Closed rootEnginear closed 1 year ago

rootEnginear commented 1 year ago

https://github.com/wevisdemo/design-systems/blob/e6ed1bd3ba4ede39fd18b74fde48ef9615f21b1e/ui/src/components/sharer/sharer.lite.tsx#L32

Although using encodeURI is functional, it is, in theory, invalid because we are using the href as the value of a query string.

https://github.com/wevisdemo/design-systems/blob/e6ed1bd3ba4ede39fd18b74fde48ef9615f21b1e/ui/src/components/sharer/sharer.lite.tsx#L61-L65

This can be fixed by changing encodeURI to encodeURIComponent

rootEnginear commented 1 year ago

Fixed in ee14175

https://github.com/wevisdemo/design-systems/blame/23ea5180a313036a5797a6b9c769fc52bbca08ee/ui/src/components/sharer/sharer.lite.tsx#L32