File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ function fromWindows1251(percentEncoded: string) {
19
19
) ;
20
20
}
21
21
22
+ const kSharedViaOM = 'Shared via <a href="https://organicmaps.app">Organic Maps</a>' ;
23
+
22
24
function normalizeNameAndTitle ( name : string | undefined ) : [ string , string ] {
23
25
let title = 'Organic Maps' ;
24
26
if ( name ) {
@@ -40,7 +42,7 @@ function normalizeNameAndTitle(name: string | undefined): [string, string] {
40
42
name = name . replace ( "'" , '’' ) ; // To embed in popup.
41
43
title = name + ' | ' + title ;
42
44
} else {
43
- name = 'Shared via <a href="https://organicmaps.app">Organic Maps</a>' ;
45
+ name = kSharedViaOM ;
44
46
}
45
47
return [ name , title ] ;
46
48
}
@@ -102,7 +104,8 @@ export async function onGe0Decode(template: string, url: string): Promise<Respon
102
104
const llz = decodeLatLonZoom ( encodedLatLonZoom ) ;
103
105
let [ name , title ] = normalizeNameAndTitle ( params . length > 1 ? params [ 1 ] : undefined ) ;
104
106
// XSS prevention.
105
- name = encodeHTML ( name ) ;
107
+ if ( name != kSharedViaOM )
108
+ name = encodeHTML ( name ) ;
106
109
title = encodeHTML ( title ) ;
107
110
108
111
template = replaceInTemplate ( template , {
You can’t perform that action at this time.
0 commit comments