Sanitizes a few snackbar messages for safety.
This commit is contained in:
parent
c9c0e0db2a
commit
14898b962f
|
@ -751,7 +751,7 @@ export default {
|
||||||
let errorMessage = errors.length > 1 ? this.$i18n.getWithVariables('info_terms_creation_failed_due_to_values_%s', [ wrongValues ]) : this.$i18n.getWithVariables('info_terms_creation_failed_due_to_value_%s', [ wrongValues ]);
|
let errorMessage = errors.length > 1 ? this.$i18n.getWithVariables('info_terms_creation_failed_due_to_values_%s', [ wrongValues ]) : this.$i18n.getWithVariables('info_terms_creation_failed_due_to_value_%s', [ wrongValues ]);
|
||||||
errorMessage += ' ' + errors[0]['errors'][0]['name'];
|
errorMessage += ' ' + errors[0]['errors'][0]['name'];
|
||||||
this.$buefy.snackbar.open({
|
this.$buefy.snackbar.open({
|
||||||
message: errorMessage,
|
message: errorMessage.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g, '/'),
|
||||||
type: 'is-danger',
|
type: 'is-danger',
|
||||||
position: 'is-bottom-right',
|
position: 'is-bottom-right',
|
||||||
pauseOnHover: true,
|
pauseOnHover: true,
|
||||||
|
|
|
@ -15,7 +15,7 @@ ConsolePlugin.install = function (Vue, options = { visual: false }) {
|
||||||
log(something) {
|
log(something) {
|
||||||
if (options.visual) {
|
if (options.visual) {
|
||||||
Vue.prototype.$buefy.snackbar.open({
|
Vue.prototype.$buefy.snackbar.open({
|
||||||
message: something,
|
message: something.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g, '/'),
|
||||||
type: 'is-secondary',
|
type: 'is-secondary',
|
||||||
position: 'is-bottom-right',
|
position: 'is-bottom-right',
|
||||||
indefinite: true,
|
indefinite: true,
|
||||||
|
@ -28,7 +28,7 @@ ConsolePlugin.install = function (Vue, options = { visual: false }) {
|
||||||
info(someInfo) {
|
info(someInfo) {
|
||||||
if (options.visual) {
|
if (options.visual) {
|
||||||
Vue.prototype.$buefy.snackbar.open({
|
Vue.prototype.$buefy.snackbar.open({
|
||||||
message: someInfo,
|
message: someInfo.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g, '/'),
|
||||||
type: 'is-primary',
|
type: 'is-primary',
|
||||||
position: 'is-bottom-right',
|
position: 'is-bottom-right',
|
||||||
duration: 5000,
|
duration: 5000,
|
||||||
|
@ -41,7 +41,7 @@ ConsolePlugin.install = function (Vue, options = { visual: false }) {
|
||||||
error(someError) {
|
error(someError) {
|
||||||
if (options.visual) {
|
if (options.visual) {
|
||||||
Vue.prototype.$buefy.snackbar.open({
|
Vue.prototype.$buefy.snackbar.open({
|
||||||
message: someError,
|
message: someError.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g, '/'),
|
||||||
type: 'is-danger',
|
type: 'is-danger',
|
||||||
position: 'is-bottom-right',
|
position: 'is-bottom-right',
|
||||||
indefinite: true,
|
indefinite: true,
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const tainacanErrorHandler = function(error) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Snackbar.open({
|
Snackbar.open({
|
||||||
message: errorMessage,
|
message: errorMessage.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g, '/'),
|
||||||
type: 'is-danger',
|
type: 'is-danger',
|
||||||
duration: duration,
|
duration: duration,
|
||||||
actionText: errorMessageDetail != '' ? i18nGet('label_know_more') : null,
|
actionText: errorMessageDetail != '' ? i18nGet('label_know_more') : null,
|
||||||
|
|
Loading…
Reference in New Issue