diff --git a/server.js b/server.js index d1bf1a6ea..bd1fb1fd5 100644 --- a/server.js +++ b/server.js @@ -1535,8 +1535,8 @@ app.post("/delchat", jsonParser, function (request, response) { app.post('/renamebackground', jsonParser, function (request, response) { if (!request.body) return response.sendStatus(400); - const oldFileName = path.join('public/backgrounds/', sanitize(request.body.old_bg)); - const newFileName = path.join('public/backgrounds/', sanitize(request.body.new_bg)); + const oldFileName = path.join(DIRECTORIES.backgrounds, sanitize(request.body.old_bg)); + const newFileName = path.join(DIRECTORIES.backgrounds, sanitize(request.body.new_bg)); if (!fs.existsSync(oldFileName)) { console.log('BG file not found');