Skip to content

Commit 1095d02

Browse files
authored
[ui] Also patch another jquery.notify plugin (#2006)
Fix bug using _this and not this. Make sure we check the message post XSS and tags stripping.
1 parent 6945f58 commit 1095d02

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

desktop/core/src/desktop/js/jquery/plugins/jquery.notify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Plugin.prototype.show = function () {
5353
_this.options.message = _this.options.message.replace(/(<([^>]+)>)/gi, ''); // escape HTML messages
5454
_this.options.message = hueUtils.deXSS(_this.options.message); // escape XSS messages
5555

56-
if (/^(504|upstream connect error)/.test(this.options.message)) {
57-
console.warn(this.options.message);
56+
if (/^(504|upstream connect error|Gateway Time-out)/.test(_this.options.message.trim())) {
57+
console.warn(_this.options.message);
5858
return;
5959
}
6060

desktop/core/src/desktop/static/desktop/js/jquery.notify.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
var _this = this;
4949
var MARGIN = 4;
5050

51+
if (/^(504|upstream connect error|Gateway Time-out)/.test(_this.options.message.trim())) {
52+
console.warn(_this.options.message);
53+
return;
54+
}
55+
5156
_this.options.message = _this.options.message.replace(/(<([^>]+)>)/ig, ''); // escape HTML messages
5257
_this.options.message = hueUtils.deXSS(_this.options.message); // escape XSS messages
5358

0 commit comments

Comments
 (0)