From 8060ed5f8e6acbfb990269e90ce7f84a4040bb99 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 21 Jan 2021 07:37:50 +1300 Subject: [PATCH] Rename `sanitizeHtml` function to `escapeTextForHtmlDisplay` which better describes it's actual function --- server/homebrew.model.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/homebrew.model.js b/server/homebrew.model.js index 05b94663a..3d417f9e8 100644 --- a/server/homebrew.model.js +++ b/server/homebrew.model.js @@ -34,10 +34,9 @@ HomebrewSchema.methods.sanatize = function(full=false){ return brew; }; -HomebrewSchema.methods.sanitizeHtml = function(){ - const brew = this.toJSON(); +HomebrewSchema.methods.escapeTextForHtmlDisplay = function(){ const replaceStrings = { '&': '&', '<': '<', '>': '>' }; - text = brew.text; + text = this.text; for (const replaceStr in replaceStrings) { text = text.replaceAll(replaceStr, replaceStrings[replaceStr]); }