From 3ec99b802193ca5153ef45c929edc433ad9a79e5 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 13 Apr 2015 10:34:23 -0400 Subject: [PATCH] #3011 --- public/src/modules/helpers.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index f48a7e8c00..aa5e2413d4 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -44,13 +44,20 @@ }; helpers.escape = function(str) { - var utils = utils || require('../utils'); - return utils.escapeHTML(str); + if (typeof utils !== 'undefined') { + return utils.escapeHTML(str); + } else { + return require('../utils').escapeHTML(str); + } }; helpers.stripTags = function(str) { - var S = S || require('string'); - return S(str).stripTags().s; + if (typeof S !== 'undefined') { + return S(str).stripTags().s; + } else { + var S = require('string'); + return S(str).stripTags().s; + } }; helpers.generateCategoryBackground = function(category) {