mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-05 22:30:07 +01:00
fix: escape config.userLang/acpLang, don't allow invalid language codes
This commit is contained in:
15
test/user.js
15
test/user.js
@@ -1550,6 +1550,21 @@ describe('User', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should error if language is invalid', function (done) {
|
||||
var data = {
|
||||
uid: testUid,
|
||||
settings: {
|
||||
userLang: '<invalid-string>',
|
||||
topicsPerPage: '10',
|
||||
postsPerPage: '5',
|
||||
},
|
||||
};
|
||||
socketUser.saveSettings({ uid: testUid }, data, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-language]]');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should set moderation note', function (done) {
|
||||
var adminUid;
|
||||
async.waterfall([
|
||||
|
||||
Reference in New Issue
Block a user