escaping dangerous places

This commit is contained in:
antelle 2020-04-23 20:06:10 +02:00
parent d30c9d9d90
commit f4e4bbbb8f
No known key found for this signature in database
GPG Key ID: 094A2F2D6136A4EE
3 changed files with 9 additions and 6 deletions

View File

@ -123,11 +123,12 @@ class ImportCsvView extends View {
this.groups = [];
for (const file of this.appModel.files) {
file.forEachGroup(group => {
let title = escape(group.title);
const title = group.title;
const spaces = [];
for (let parent = group; parent.parentGroup; parent = parent.parentGroup) {
title = '  ' + title;
spaces.push(' ', ' ');
}
this.groups.push({ id: group.id, fileId: file.id, title });
this.groups.push({ id: group.id, fileId: file.id, spaces, title });
});
}
}

View File

@ -1,7 +1,6 @@
import { View } from 'framework/views/view';
import { RuntimeInfo } from 'const/runtime-info';
import { Links } from 'const/links';
import { escape } from 'util/fn';
import { Launcher } from 'comp/launcher';
import template from 'templates/settings/settings-help.hbs';
@ -30,7 +29,7 @@ class SettingsHelpView extends View {
encodeURIComponent('!please describe your issue here!\n\n' + appInfo),
desktopLink: Links.Desktop,
webAppLink: Links.WebApp,
appInfo: escape(appInfo)
appInfo
});
}
}

View File

@ -57,7 +57,10 @@
<select class="import-csv__target-select" id="import-csv__target-select">
<option value="" selected>{{res 'importNewFile'}}</option>
{{#each groups as |group|}}
<option value="{{group.id}}" data-file="{{group.fileId}}">{{{group.title}}}</option>
<option value="{{group.id}}" data-file="{{group.fileId}}">
{{#if spaces}}{{#each spaces}}&nbsp;{{/each}}{{/if}}
{{group.title}}
</option>
{{/each}}
</select>
</div>