satnav-js icon indicating copy to clipboard operation
satnav-js copied to clipboard

Spaces screw up SatNav

Open jdarling opened this issue 10 years ago • 3 comments

While completely valid in the URL spaces (or any URL encoded character actually) screw up SatNav.

While looking at this I noticed that line 81 reads:

return '([\\w-.]+)?';

But since spaces get encoded to a + the above breaks. Taking into account also that special characters could be encoded with a % symbol, below makes more sense:

return '([\\w-.+%]+)?';

But, really, what we are interested in is anything that isn't {} or /, so why not use:

return '([^{}\\/]+)?';

jdarling avatar Apr 03 '14 20:04 jdarling

I will look into this shortly.

If you would like submit a PR, I would be happy to test and merge :)

f5io avatar Apr 07 '14 13:04 f5io

No problem, PR listed above.

jdarling avatar Apr 07 '14 14:04 jdarling

nice @jdarling

srsholmes avatar Apr 17 '17 11:04 srsholmes