Compare owner name case-insensitively when deleting channel

This commit is contained in:
Calvin Montgomery 2017-03-21 19:47:31 -07:00
parent 0613083eb0
commit 309cd40da2
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "3.34.4",
"version": "3.34.5",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View File

@ -325,7 +325,7 @@ function handleDeleteChannel(req, res) {
return;
}
if (channel.owner !== req.user.name && req.user.global_rank < 255) {
if ((!channel.owner || channel.owner.toLowerCase() !== req.user.name.toLowerCase()) && req.user.global_rank < 255) {
db.channels.listUserChannels(req.user.name, function (err2, channels) {
sendPug(res, "account-channels", {
channels: err2 ? [] : channels,