mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
fixing more exposed XSS outlets in groups frontend
This commit is contained in:
@@ -134,7 +134,7 @@ define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker',
|
|||||||
};
|
};
|
||||||
|
|
||||||
Details.deleteGroup = function() {
|
Details.deleteGroup = function() {
|
||||||
bootbox.confirm('Are you sure you want to delete the group: ' + ajaxify.variables.get('group_name'), function(confirm) {
|
bootbox.confirm('Are you sure you want to delete the group: ' + utils.escapeHTML(ajaxify.variables.get('group_name')), function(confirm) {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
bootbox.prompt('Please enter the name of this group in order to delete it:', function(response) {
|
bootbox.prompt('Please enter the name of this group in order to delete it:', function(response) {
|
||||||
if (response === ajaxify.variables.get('group_name')) {
|
if (response === ajaxify.variables.get('group_name')) {
|
||||||
@@ -142,7 +142,7 @@ define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker',
|
|||||||
groupName: ajaxify.variables.get('group_name')
|
groupName: ajaxify.variables.get('group_name')
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
app.alertSuccess('[[groups:event.deleted, ' + ajaxify.variables.get('group_name') + ']]');
|
app.alertSuccess('[[groups:event.deleted, ' + utils.escapeHTML(ajaxify.variables.get('group_name')) + ']]');
|
||||||
ajaxify.go('groups');
|
ajaxify.go('groups');
|
||||||
} else {
|
} else {
|
||||||
app.alertError(err.message);
|
app.alertError(err.message);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ define('forum/groups/list', function() {
|
|||||||
name: name
|
name: name
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
ajaxify.go('groups/' + name);
|
ajaxify.go('groups/' + encodeURIComponent(name));
|
||||||
} else {
|
} else {
|
||||||
app.alertError(err.message);
|
app.alertError(err.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,6 +248,10 @@
|
|||||||
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
escapeHTML: function(raw) {
|
||||||
|
return raw.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">");
|
||||||
|
},
|
||||||
|
|
||||||
isAndroidBrowser: function() {
|
isAndroidBrowser: function() {
|
||||||
// http://stackoverflow.com/questions/9286355/how-to-detect-only-the-native-android-browser
|
// http://stackoverflow.com/questions/9286355/how-to-detect-only-the-native-android-browser
|
||||||
var nua = navigator.userAgent;
|
var nua = navigator.userAgent;
|
||||||
|
|||||||
Reference in New Issue
Block a user