Fix urlencoding of hash

pull/54/merge
Candid Dauth 2016-10-23 13:09:26 +03:00
rodzic 6d15280fdd
commit b7ce68895f
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -35,7 +35,7 @@
if(hash.indexOf("=") != -1 && hash.indexOf("/") == -1)
args = oldToNew(hash);
else
args = hash.split("/");
args = hash.split("/").map(decodeURIComponentTolerantly);
var ret = L.Hash.parseHash(args.slice(0, 3).join("/"));
@ -75,11 +75,13 @@
l.push(i);
}
ret += "/" + l.join("-");
var additionalParts = [ l.join("-") ];
var searchHash = map.searchUi.getCurrentSearchForHash();
if(searchHash)
ret += "/" + searchHash.join("/");
additionalParts = additionalParts.concat(searchHash);
ret += "/" + additionalParts.map(encodeURIComponent).join("/");
return ret;
}