Skip to content

Commit

Permalink
fix: safer digit handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Mar 29, 2023
1 parent 25e085b commit db80bed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ async function parsePB(param) {
mapArea.lat = floatVal;
};
} else if (val.match(/^\d+z/)) { // decode `base64` to `degrees minutes seconds direction` to `lat lng`
let marker = atob(val.substring(2));
let marker = atob(val.replace(/^\d+z/, ''));
marker.replace(/[^\d\s\-\.\'\"\°SNWE]/g, '');
markers.push({ latlon: parseDMS(marker), label: '' });
} else if (val.match(/^\d+s/)) {
val = val.substring(2);
val = val.replace(/^\d+s/, '');

if (val.match(/^0x[\da-f]+:0x[\da-f]+$/i)) {
// two hex parts corresponding to ID of map object? -> FTID????
Expand Down

0 comments on commit db80bed

Please sign in to comment.