From ce09813bf026c61ec5870d9c93d1adf45a68870f Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Tue, 10 Apr 2018 14:06:25 -0600
Subject: [PATCH] Show failed minify file and fix username editing privilege
(#6445)
* Fix global mods and admins being unable to change usernames
* Message file which failed to minify
---
src/meta/minifier.js | 2 +-
src/socket.io/user/profile.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/meta/minifier.js b/src/meta/minifier.js
index 26bf048e93..c48bbb890f 100644
--- a/src/meta/minifier.js
+++ b/src/meta/minifier.js
@@ -234,7 +234,7 @@ function minifyAndSave(data, callback) {
});
if (minified.error) {
- return callback(minified.error);
+ return callback({ stack: 'Error minifying ' + minified.error.filename + '\n' + minified.error.stack });
}
async.parallel([
diff --git a/src/socket.io/user/profile.js b/src/socket.io/user/profile.js
index 9d88713028..1391ba2f3c 100644
--- a/src/socket.io/user/profile.js
+++ b/src/socket.io/user/profile.js
@@ -90,7 +90,7 @@ module.exports = function (SocketUser) {
return next(new Error('[[error:no-privileges]]'));
}
- if ((!results.isAdmin || !results.isGlobalMod) && !isSelf) {
+ if (!isSelf && !(results.isAdmin || results.isGlobalMod)) {
return next(new Error('[[error:no-privileges]]'));
}