Skip to content

Commit b4bb61e

Browse files
committed
Do not encode url in the default name/title
Signed-off-by: Alexander Borsuk <[email protected]>
1 parent 5ed1312 commit b4bb61e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ge0.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ function fromWindows1251(percentEncoded: string) {
1919
);
2020
}
2121

22+
const kSharedViaOM = 'Shared via <a href="https://organicmaps.app">Organic Maps</a>';
23+
2224
function normalizeNameAndTitle(name: string | undefined): [string, string] {
2325
let title = 'Organic Maps';
2426
if (name) {
@@ -40,7 +42,7 @@ function normalizeNameAndTitle(name: string | undefined): [string, string] {
4042
name = name.replace("'", '&rsquo;'); // To embed in popup.
4143
title = name + ' | ' + title;
4244
} else {
43-
name = 'Shared via <a href="https://organicmaps.app">Organic Maps</a>';
45+
name = kSharedViaOM;
4446
}
4547
return [name, title];
4648
}
@@ -102,7 +104,8 @@ export async function onGe0Decode(template: string, url: string): Promise<Respon
102104
const llz = decodeLatLonZoom(encodedLatLonZoom);
103105
let [name, title] = normalizeNameAndTitle(params.length > 1 ? params[1] : undefined);
104106
// XSS prevention.
105-
name = encodeHTML(name);
107+
if (name != kSharedViaOM)
108+
name = encodeHTML(name);
106109
title = encodeHTML(title);
107110

108111
template = replaceInTemplate(template, {

0 commit comments

Comments
 (0)