mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
fix #3993
This commit is contained in:
@@ -124,10 +124,6 @@ export default {
|
||||
types = this.defaultAccountTypeFilters.join(',');
|
||||
}
|
||||
this.updateACURI(types);
|
||||
},
|
||||
name() {
|
||||
// console.log('Watch: name()');
|
||||
// console.log(this.name);
|
||||
}
|
||||
},
|
||||
methods:
|
||||
@@ -141,7 +137,7 @@ export default {
|
||||
for (const key in res.data) {
|
||||
if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||
current = res.data[key];
|
||||
current.description = this.escapeHtml(res.data[key].description)
|
||||
current.name_with_balance = this.escapeHtml(res.data[key].name_with_balance)
|
||||
escapedData.push(current);
|
||||
}
|
||||
}
|
||||
@@ -151,6 +147,25 @@ export default {
|
||||
// any error handler
|
||||
})
|
||||
},
|
||||
escapeHtml: function (string) {
|
||||
|
||||
let entityMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'/': '/',
|
||||
'`': '`',
|
||||
'=': '='
|
||||
};
|
||||
|
||||
return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
|
||||
return entityMap[s];
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
updateACURI: function (types) {
|
||||
this.accountAutoCompleteURI =
|
||||
document.getElementsByTagName('base')[0].href +
|
||||
|
@@ -100,7 +100,7 @@ export default {
|
||||
for (const key in res.data) {
|
||||
if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||
current = res.data[key];
|
||||
current.description = this.escapeHtml(res.data[key].description)
|
||||
current.name = this.escapeHtml(res.data[key].name)
|
||||
escapedData.push(current);
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,25 @@ export default {
|
||||
// any error handler
|
||||
})
|
||||
},
|
||||
escapeHtml: function (string) {
|
||||
|
||||
let entityMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'/': '/',
|
||||
'`': '`',
|
||||
'=': '='
|
||||
};
|
||||
|
||||
return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
|
||||
return entityMap[s];
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
handleInput(e) {
|
||||
if (typeof this.$refs.input.value === 'string') {
|
||||
this.$emit('input', this.$refs.input.value);
|
||||
|
Reference in New Issue
Block a user