TargetURLSelector: encode URL

This commit is contained in:
He4eT 2023-06-12 23:45:10 +03:00
commit 8a35549002

View file

@ -4,7 +4,7 @@ export default function TargetURLSelector ({ theme, setLocation, buildLink }) {
const onKeyPress = ({ keyCode, target }) => {
if (keyCode !== 13) return
const url = target.value
const url = encodeURI(target.value)
if (urlRE.test(url)) {
setLocation(buildLink({ url, theme }))